---
title: "CWE-393: Return of Wrong Status Code"
url: https://radicalnotion.ai/cwe/cwe-393
type: cwe
description: "A function or operation returns an incorrect return value or status code that does not indicate the true result of execution, causing the product to modify its behavior based on the incorrect result."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-393: Return of Wrong Status Code

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Draft
- **CVEs with this as primary weakness:** 33
- **Of those, in CISA KEV:** 0
- **New in 2026:** 20
- **CWE catalog version:** 4.21

## Description

A function or operation returns an incorrect return value or status code that does not indicate the true result of execution, causing the product to modify its behavior based on the incorrect result.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity, Other | Unexpected State, Alter Execution Logic | This weakness can lead to unpredictable behavior. If the function is used to make security-critical decisions or provide security-critical information, then the wrong status code can cause the product to assume that an action is safe or correct, even when it is not. This weakness could place the system in a state that could lead unexpected logic to be executed or other unintended behaviors. |

## Detection methods

### Fuzzing

Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs - either randomly or algorithmically - and dynamically invoking the code with those inputs. Even with random inputs, it is often capable of generating unexpected results such as crashes, memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases that clearly indicate bugs, which helps developers to diagnose the issues.

Effectiveness: High

## Demonstrative examples

### Example 1

In the following example, an HTTP 404 status code is returned in the event of an IOException encountered in a Java servlet. A 404 code is typically meant to indicate a non-existent resource and would be somewhat misleading in this case.

Bad code:

```java
try {

    // something that might throw IOException
    ...
} catch (IOException ioe) {
    response.sendError(SC_NOT_FOUND);
}
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2003-1132 | DNS server returns wrong response code for non-existent AAAA record, which effectively says that the domain is inaccessible. |
| CVE-2001-1509 | Hardware-specific implementation of system call causes incorrect results from geteuid. |
| CVE-2001-1559 | Chain: System call returns wrong value (CWE-393), leading to a resultant NULL dereference (CWE-476). |
| CVE-2014-1266 | Chain: incorrect "goto" in Apple SSL product bypasses certificate validation, allowing Adversary-in-the-Middle (AITM) attack (Apple "goto fail" bug). CWE-705 (Incorrect Control Flow Scoping) -\> CWE-561 (Dead Code) -\> CWE-295 (Improper Certificate Validation) -\> CWE-393 (Return of Wrong Status Code) -\> CWE-300 (Channel Accessible by Non-Endpoint). The code's whitespace indentation did not reflect the actual control flow (CWE-1114) and did not explicitly delimit the block (CWE-483), which could have made it more difficult for human code auditors to detect the vulnerability. |

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

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-99607 | ext2: preserve IOMAP\_F\_DIRTY for extending direct writes | critical | 9.8 | - | No | 2026-11-20 |
| CVE-2026-99575 | f2fs: return -EIO for a lost inode block after cp\_error | critical | 9.8 | - | No | 2026-11-20 |
| CVE-2024-49117 | Windows Hyper-V Remote Code Execution Vulnerability | high | 8.8 | - | No | 2024-12-10 |
| CVE-2026-92821 | Sssd: sssd: access control bypass via premature ldap access rule evaluation | high | 8.1 | - | No | 2026-10-06 |
| CVE-2025-5987 | Libssh: invalid return code for chacha20 poly1305 with openssl backend | high | 8.1 | - | No | 2025-07-07 |
| CVE-2026-53092 | bpf: Fix linked reg delta tracking when src\_reg == dst\_reg | high | 7.8 | - | No | 2026-06-24 |
| CVE-2025-22114 | btrfs: don't clobber ret in btrfs\_validate\_super() | high | 7.8 | - | No | 2025-04-16 |
| CVE-2024-42296 | f2fs: fix return value of f2fs\_convert\_inline\_inode() | high | 7.8 | - | No | 2024-08-17 |
| CVE-2024-26955 | nilfs2: prevent kernel bug at submit\_bh\_wbc() | high | 7.8 | - | No | 2024-05-01 |
| CVE-2026-72374 | afs: Fix callback service message parsers to pass through -EAGAIN | high | 7.5 | - | No | 2026-08-15 |
| CVE-2025-32414 | libxml2: Out-of-Bounds Read in libxml2 | high | 7.5 | - | No | 2025-04-08 |
| CVE-2021-46960 | cifs: Return correct error code from smb2\_get\_enc\_key | high | 7.5 | - | No | 2024-02-27 |

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-684](https://radicalnotion.ai/cwe/cwe-684) | Incorrect Provision of Specified Functionality |
| Parent | [CWE-703](https://radicalnotion.ai/cwe/cwe-703) | Improper Check or Handling of Exceptional Conditions |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| PLOVER | Wrong Status Code | - | - |
| Software Fault Patterns | Incorrect Exception Behavior | SFP6 | - |

## Frequently asked questions

### What is CWE-393?

A function or operation returns an incorrect return value or status code that does not indicate the true result of execution, causing the product to modify its behavior based on the incorrect result.

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

33 recorded CVEs are attributed to CWE-393, including CVE-2026-99607, CVE-2026-99575 and CVE-2024-49117.

### How is CWE-393 detected?

Fuzzing: Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs - either randomly or algorithmically - and dynamically invoking the code with those inputs. Even with random inputs, it is often capable of generating unexpected results such as crashes, memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases that clearly indicate bugs, which helps developers to diagnose the issues.

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

Exploiting CWE-393 can lead to: Unexpected State, Alter Execution Logic.

### Is CWE-393 actively exploited?

33 recorded CVEs are caused by CWE-393; none are currently in CISA's KEV catalog of actively exploited flaws.

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

---

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