CWEweakness
CWE-394 Unexpected Status Code or Return Value
- Abstraction
- Base
- Structure
- Simple
- Status
- Draft
- Languages
- Not Language-Specific
- CWE version
- 5.0
Description
The product does not properly check when a function or operation returns a value that is legitimate for the function, but is not expected by the product.
Common consequences
• Integrity, Other: Unexpected State, Alter Execution Logic
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.)
Observed examples
• CVE-2004-1395: Certain packets (zero byte and other lengths) cause a recvfrom call to produce an unexpected return code that causes a server's listening loop to exit.
• CVE-2002-2124: Unchecked return code from recv() leads to infinite loop.
• CVE-2005-2553: Kernel function does not properly handle when a null is returned by a function call, causing it to call another function that it shouldn't.
• CVE-2005-1858: Memory not properly cleared when read() function call returns fewer bytes than expected.
• CVE-2000-0536: Bypass access restrictions when connecting from IP whose DNS reverse lookup does not return a hostname.
• CVE-2001-0910: Bypass access restrictions when connecting from IP whose DNS reverse lookup does not return a hostname.
• CVE-2004-2371: Game server doesn't check return values for functions that handle text strings and associated size values.
• CVE-2005-1267: Resultant infinite loop when function call returns -1 value.
Related
Observed example · CVE (8)
- CVE-2005-2553 The find_target function in ptrace32.c in the Linux kernel 2.4.x before 2.4.29 does not properly handle a NULL return value from another… vulnerability
- CVE-2005-1267 The bgp_update_print function in tcpdump 3.x does not properly handle a -1 return value from the decode_prefix4 function, which allows… vulnerability
- CVE-2005-1858 FUSE 2.x before 2.3.0 does not properly clear previously used memory from unfilled pages when the filesystem returns a short byte count to… vulnerability
- CVE-2004-1395 The Lithtech engine, as used in (1) Contract Jack 1.1 and earlier, (2) No one lives forever 2 1.3 and earlier, (3) Tron 2.0 1.042 and… vulnerability
- CVE-2004-2371 Multiple Red Storm web-based games, including Ghost Recon 1.4 and earlier, Desert Siege, and The Sum of all Fears 1.1.1.0 and earlier, do… vulnerability
- CVE-2002-2124 The recvn and sendn functions in nylon 0.2 do not check when the recv function call returns 0, which allows remote attackers to cause a… vulnerability
- CVE-2001-0910 Legato Networker before 6.1 allows remote attackers to bypass access restrictions and gain privileges on the Networker interface by… vulnerability
- CVE-2000-0536 xinetd 2.1.8.x does not properly restrict connections if hostnames are used for access control and the connecting host does not have a… vulnerability
Child of · CWE (1)
- CWE-754 Improper Check for Unusual or Exceptional Conditions weakness
Referenced by CVE · weakness (17)
- CVE-2026-107785 Crux Agent from 1.9.0 before 2.0.3 uses the full SKA bilocation key as the WireGuard preshared key. vulnerability
- CVE-2026-73064 In Mbed TLS 3.2.0 though 3.6.6 and 4.0.0 through 4.1.0, an attacker who can cause an entropy source to fail can remove or inject bytes into… vulnerability
- CVE-2026-76956 In libexpat 2.8.2 and 2.8.3 before 2.8.4, misinterpretation of getentropy's return code leads to insufficient entropy, which results in… vulnerability
- CVE-2026-25085 A vulnerability exists in Copeland XWEB Pro version 1.12.1 and prior, in which an unexpected return value from the authentication routine… vulnerability
- CVE-2025-48510 Improper return value within AMD uProf can allow a local attacker to bypass KSLR, potentially resulting in loss of confidentiality or… vulnerability
- CVE-2025-12515 Systemic Internal Server Errors - HTTP 500 ResponseThis issue affects BLU-IC2: through 1.19.5; BLU-IC4: through 1.19.5 . vulnerability
- CVE-2025-12516 Lack of Graceful Error Handling - HTTP 5xx ErrorThis issue affects BLU-IC2: through 1.19.5; BLU-IC4: through 1.19.5 . vulnerability
- CVE-2025-22854 Improper handling of non-200 http responses in the PingFederate Google Adapter leads to thread exhaustion under normal usage conditions. vulnerability
- CVE-2025-23013 In Yubico pam-u2f before 1.3.1, local privilege escalation can sometimes occur. vulnerability
- CVE-2024-1713 A user who can create objects in a database with plv8 3.2.1 installed is able to cause deferred triggers to execute as the Superuser during… vulnerability
- CVE-2023-48429 A vulnerability has been identified in SINEC INS (All versions < V1.0 SP2 Update 2). vulnerability
- CVE-2023-25948 Server information leak of configuration data when an error is generated in response to a specially crafted message. vulnerability
- CVE-2023-28975 An Unexpected Status Code or Return Value vulnerability in the kernel of Juniper Networks Junos OS allows an unauthenticated attacker with… vulnerability
- CVE-2022-24880 flask-session-captcha is a package which allows users to extend Flask by adding an image based captcha stored in a server side session. vulnerability
- CVE-2018-20802 A user authorized to perform database queries may trigger denial of service by issuing specially crafted queries with compound indexes… vulnerability
- CVE-2019-20924 A user authorized to perform database queries may trigger denial of service by issuing specially crafted queries which trigger an invariant… vulnerability
- CVE-2019-0066 An unexpected status return value weakness in the Next-Generation Multicast VPN (NG-mVPN) service of Juniper Networks Junos OS allows… vulnerability
Referenced by OWASP · mapped cwe (1)
- A10:2025 Mishandling of Exceptional Conditions Top 10 2025