CWEweakness

CWE-393 Return of Wrong Status Code

Official page ↗
Abstraction
Base
Structure
Simple
Status
Draft
Languages
Not Language-Specific
CWE version
5.0

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.

Common consequences

• 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.

Observed examples

• 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.

Related

Observed example · CVE (4)

  • CVE-2014-1266 The SSLVerifySignedServerKeyExchange function in libsecurity_ssl/lib/sslKeyExchange.c in the Secure Transport feature in the Data Security… vulnerability
  • CVE-2003-1132 The DNS server for Cisco Content Service Switch (CSS) 11000 and 11500, when prompted for a nonexistent AAAA record, responds with response… vulnerability
  • CVE-2001-1509 geteuid in Itanium Architecture (IA) running on HP-UX 11.20 does not properly identify a user's effective user id, which could allow local… vulnerability
  • CVE-2001-1559 The uipc system calls (uipc_syscalls.c) in OpenBSD 2.9 and 3.0 provide user mode return instead of versus rval kernel mode values to the… vulnerability

Child of · CWE (2)

  • CWE-684 Incorrect Provision of Specified Functionality weakness
  • CWE-703 Improper Check or Handling of Exceptional Conditions weakness

Referenced by CVE · weakness (15)

  • CVE-2026-97381 Legacy Update is a tool for activating and installing updates on legacy Windows PCs. vulnerability
  • CVE-2026-92821 A flaw was found in SSSD. vulnerability
  • CVE-2026-85087 Improper certificate validation, Return of wrong status code vulnerability in Apache Thrift python bindings. vulnerability
  • CVE-2026-85483 Use of uninitialized resource, Return of wrong status code vulnerability in Apache Thrift c_glib bindings. vulnerability
  • CVE-2026-92834 Use of uninitialized resource, Return of wrong status code vulnerability in Apache Thrift C++ WebSocket server. vulnerability
  • CVE-2026-55958 Out-of-bounds write in the Renesas TSIP TLS 1.3 transcript buffer. vulnerability
  • CVE-2026-53092 In the Linux kernel, the following vulnerability has been resolved: bpf: Fix linked reg delta tracking when src_reg == dst_reg Consider the… vulnerability
  • CVE-2026-9058 For untrusted certificates that contain the "Authority Information Access - caIssuers URI" extension, Szafir SDK will automatically… vulnerability
  • CVE-2026-42246 Net::IMAP implements Internet Message Access Protocol (IMAP) client functionality in Ruby. vulnerability
  • CVE-2025-24531 In OpenSC pam_pkcs11 before 0.6.13, pam_sm_authenticate() wrongly returns PAM_IGNORE in many error situations (such as an error triggered… vulnerability
  • CVE-2025-5987 A flaw was found in libssh when using the ChaCha20 cipher with the OpenSSL library. vulnerability
  • CVE-2025-32414 In libxml2 before 2.13.8 and 2.14.x before 2.14.2, out-of-bounds memory access can occur in the Python API (Python bindings) because of an… vulnerability
  • CVE-2024-49117 Windows Hyper-V Remote Code Execution Vulnerability vulnerability
  • CVE-2023-37897 Grav is a file-based Web-platform built in PHP. vulnerability
  • CVE-2020-5401 Cloud Foundry Routing Release, versions prior to 0.197.0, contains GoRouter, which allows malicious clients to send invalid headers,… vulnerability

Referenced by CWE · has member (1)