---
title: "CWE-669: Incorrect Resource Transfer Between Spheres"
url: https://radicalnotion.ai/cwe/cwe-669
type: cwe
description: "The product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere, in a manner that provides unintended control over that resource."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-669: Incorrect Resource Transfer Between Spheres

- **Abstraction:** Class
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 113
- **Of those, in CISA KEV:** 2
- **New in 2026:** 56
- **CWE catalog version:** 4.21

## Description

The product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere, in a manner that provides unintended control over that resource.

## Background

A "control sphere" is a set of resources and behaviors that are accessible to a single actor, or a group of actors. A product's security model will typically define multiple spheres, possibly implicitly. For example, a server might define one sphere for "administrators" who can create new user accounts with subdirectories under /home/server/, and a second sphere might cover the set of users who can create or delete files within their own subdirectories. A third sphere might be "users who are authenticated to the operating system on which the product is installed." Each sphere has different sets of actors and allowable behaviors.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |
| Implementation | REALIZATION: This weakness is caused during implementation of an architectural security tactic. |
| Operation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Integrity | Read Application Data, Modify Application Data, Unexpected State | - |

## Demonstrative examples

### Example 1

The following code demonstrates the unrestricted upload of a file with a Java servlet and a path traversal vulnerability. The action attribute of an HTML form is sending the upload file request to the Java servlet.

Good code:

```html
<form action="FileUploadServlet" method="post" enctype="multipart/form-data">

Choose a file to upload:
<input type="file" name="filename"/>
<br/>
<input type="submit" name="submit" value="Submit"/>

</form>
```

Bad code:

```java
public class FileUploadServlet extends HttpServlet {
    ...

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        String contentType = request.getContentType();

        // the starting position of the boundary header
        int ind = contentType.indexOf("boundary=");
        String boundary = contentType.substring(ind+9);

        String pLine = new String();
        String uploadLocation = new String(UPLOAD_DIRECTORY_STRING); //Constant value

        // verify that content type is multipart form data
        if (contentType != null && contentType.indexOf("multipart/form-data") != -1) {
            // extract the filename from the Http header
            BufferedReader br = new BufferedReader(new InputStreamReader(request.getInputStream()));
            ...
            pLine = br.readLine();
            String filename = pLine.substring(pLine.lastIndexOf("\\"), pLine.lastIndexOf("\""));
            ...

            // output the file to the local upload directory
            try {
                BufferedWriter bw = new BufferedWriter(new FileWriter(uploadLocation+filename, true));
                for (String line; (line=br.readLine())!=null; ) {
                    if (line.indexOf(boundary) == -1) {
                        bw.write(line);
                        bw.newLine();
                        bw.flush();
                    }
                } //end of for loop
                bw.close();

            } catch (IOException ex) {...}
            // output successful upload response HTML page
        }
        // output unsuccessful upload response HTML page
        else
        {...}
    }
        ...
}
```

### Example 2

This code includes an external script to get database credentials, then authenticates a user against the database, allowing access to the application.

Bad code:

```php
//assume the password is already encrypted, avoiding CWE-312

function authenticate($username,$password){

    include("http://external.example.com/dbInfo.php");

    //dbInfo.php makes $dbhost, $dbuser, $dbpass, $dbname available
    mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
    mysql_select_db($dbname);
    $query = 'Select * from users where username='.$username.' And password='.$password;
    $result = mysql_query($query);

    if(mysql_numrows($result) == 1){
        mysql_close();
        return true;
    }
    else{
        mysql_close();
        return false;
    }

}
```

### Example 3

This code either generates a public HTML user information page or a JSON response containing the same user information.

Bad code:

```php
// API flag, output JSON if set
$json = $_GET['json']
$username = $_GET['user']
if(!$json)
{
    $record = getUserRecord($username);
    foreach($record as $fieldName => $fieldValue)
    {
        if($fieldName == "email_address") {

            // skip displaying user emails
            continue;
        }
        else{
            writeToHtmlPage($fieldName,$fieldValue);
        }
    }
}
else
{
    $record = getUserRecord($username);
    echo json_encode($record);
}
```

The programmer is careful to not display the user's e-mail address when displaying the public HTML page. However, the e-mail address is not removed from the JSON response, exposing the user's e-mail address.

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2021-22909 | Chain: router's firmware update procedure uses curl with "-k" (insecure) option that disables certificate validation (CWE-295), allowing adversary-in-the-middle (AITM) compromise with a malicious firmware image (CWE-494). |
| CVE-2023-5227 | PHP-based FAQ management app does not check the MIME type for uploaded images |
| CVE-2005-0406 | Some image editors modify a JPEG image, but the original EXIF thumbnail image is left intact within the JPEG. (Also an interaction error). |

## Real CVEs with this weakness (sample of 12 of 113)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-31431 | crypto: algif\_aead - Revert to operating out-of-place | high | 8.5 | - | Yes | 2026-04-22 |
| CVE-2026-111793 | Openwave Messaging Limited Webtop Media Transcoder Incorrect Resource Transfer Between Spheres Vulnerability | medium | 4.3 | - | Yes | 2026-10-16 |
| CVE-2024-56719 | net: stmmac: fix TSO DMA API usage causing oops | critical | 10.0 | - | No | 2024-12-29 |
| CVE-2021-30120 | 2FA bypass in Kaseya VSA \<= v9.5.6 | critical | 9.9 | - | No | 2021-07-09 |
| CVE-2026-75003 | In Roundcube Webmail before 1.6.18 and 1.7.x before 1.7.3, an unclosed url() in a FuncIRI... | critical | 9.8 | - | No | 2026-08-17 |
| CVE-2025-67895 | Apache Airflow Providers Edge3: Edge3 Worker RPC RCE on Airflow 2 | critical | 9.8 | - | No | 2025-12-17 |
| CVE-2020-5800 | - | critical | 9.8 | - | No | 2020-12-07 |
| CVE-2020-15892 | - | critical | 9.8 | - | No | 2020-07-22 |
| CVE-2016-5062 | Aternity version 9 vulnerable to cross-site scripting and remote code execution | critical | 9.8 | - | No | 2016-09-29 |
| CVE-2026-20194 | Cisco Identity Services Engine Hardening Release - Incorrect Resource Transfer Vulnerabilities | critical | 9.1 | - | No | 2026-09-16 |
| CVE-2023-31114 | - | critical | 9.1 | - | No | 2023-06-07 |
| CVE-2026-33265 | - | critical | 9.0 | - | No | 2026-03-18 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-664](https://radicalnotion.ai/cwe/cwe-664) | Improper Control of a Resource Through its Lifetime |
| Child | [CWE-212](https://radicalnotion.ai/cwe/cwe-212) | Improper Removal of Sensitive Information Before Storage or Transfer |
| Child | [CWE-243](https://radicalnotion.ai/cwe/cwe-243) | Creation of chroot Jail Without Changing Working Directory |
| Child | [CWE-434](https://radicalnotion.ai/cwe/cwe-434) | Unrestricted Upload of File with Dangerous Type |
| Child | [CWE-494](https://radicalnotion.ai/cwe/cwe-494) | Download of Code Without Integrity Check |
| Child | [CWE-565](https://radicalnotion.ai/cwe/cwe-565) | Reliance on Cookies without Validation and Integrity Checking |
| Child | [CWE-829](https://radicalnotion.ai/cwe/cwe-829) | Inclusion of Functionality from Untrusted Control Sphere |
| Child | [CWE-1420](https://radicalnotion.ai/cwe/cwe-1420) | Exposure of Sensitive Information during Transient Execution |
| Related | [CWE-244](https://radicalnotion.ai/cwe/cwe-244) | Improper Clearing of Heap Memory Before Release |

## Frequently asked questions

### What is CWE-669?

The product does not properly transfer a resource/behavior to another sphere, or improperly imports a resource/behavior from another sphere, in a manner that provides unintended control over that resource.

### What CVEs are caused by CWE-669?

113 recorded CVEs are attributed to CWE-669, including CVE-2026-31431, CVE-2026-111793 and CVE-2024-56719. 2 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### What are the consequences of CWE-669?

Exploiting CWE-669 can lead to: Read Application Data, Modify Application Data, Unexpected State.

### Is CWE-669 actively exploited?

Yes. 2 CWE-669 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 113 recorded CVEs.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/669.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/cwe/cwe-669). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
