---
title: "CWE-797: Only Filtering Special Elements at an Absolute Position"
url: https://radicalnotion.ai/cwe/cwe-797
type: cwe
description: "The product receives data from an upstream component, but only accounts for special elements at an absolute position (e.g. \"byte number 10\"), thereby missing remaining special elements that may exist before sending it to a downstream component."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-797: Only Filtering Special Elements at an Absolute Position

- **Abstraction:** Variant
- **Structure:** Simple
- **Status:** Incomplete
- **CVEs with this as primary weakness:** 1
- **Of those, in CISA KEV:** 0
- **New in 2026:** 1
- **CWE catalog version:** 4.21

## Description

The product receives data from an upstream component, but only accounts for special elements at an absolute position (e.g. "byte number 10"), thereby missing remaining special elements that may exist before sending it to a downstream component.

## Modes of introduction

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

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity | Unexpected State | - |

## Demonstrative examples

### Example 1

The following code takes untrusted input and uses a substring function to filter a 3-character "../" element located at the 0-index position of the input string. It then appends this result to the /home/user/ directory and attempts to read the file in the final resulting path.

Bad code:

```perl
my $Username = GetUntrustedInput();
if (substr($Username, 0, 3) eq '../') {
    $Username = substr($Username, 3);
}
my $filename = "/home/user/" . $Username;
ReadAndSendFile($filename);
```

Attack code:

```
../../../etc/passwd
```

Result code:

```
../../etc/passwd
```

Result code:

```
/home/user/../../etc/passwd
```

## Real CVEs with this weakness

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-59107 | Shared SSH Authentication Key in vSolution Matrix File Sharing | critical | 9.2 | - | No | 2026-10-26 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-795](https://radicalnotion.ai/cwe/cwe-795) | Only Filtering Special Elements at a Specified Location |

## Frequently asked questions

### What is CWE-797?

The product receives data from an upstream component, but only accounts for special elements at an absolute position (e.g. "byte number 10"), thereby missing remaining special elements that may exist before sending it to a downstream component.

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

1 recorded CVE is attributed to CWE-797: CVE-2026-59107.

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

Exploiting CWE-797 can lead to: Unexpected State.

### Is CWE-797 actively exploited?

1 recorded CVE is caused by CWE-797; it is not currently in CISA's KEV catalog of actively exploited flaws.

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

---

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