CWE-393 · Słabość
Return of Wrong Status Code
- Abstrakcja
- Bazowa
- Status
- Szkic
- Dodano
- 19 lipca 2006
- Ostatnia zmiana
- 11 grudnia 2025
Opis
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.
This 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.
Skutki
Integrity, Other
Unexpected State; Alter Execution Logic
This weakness could place the system in a state that could lead unexpected logic to be executed or other unintended behaviors.
Przykłady podatności
- 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.
Słabość nadrzędna
Kiedy powstaje
- Implementation
Dotyczy
Not Language-Specific
Uwagi
This can be primary or resultant, but it is probably most often primary to other issues.
Wpis z katalogu CWE 4.20.