CWE-670 · Słabość
Always-Incorrect Control Flow Implementation
- Abstrakcja
- Klasa
- Status
- Szkic
- Dodano
- 11 kwietnia 2008
- Ostatnia zmiana
- 11 grudnia 2025
Opis
The code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated.
This weakness captures cases in which a particular code segment is always incorrect with respect to the algorithm that it is implementing. For example, if a C programmer intends to include multiple statements in a single block but does not include the enclosing braces (CWE-483), then the logic is always incorrect. This issue is in contrast to most weaknesses in which the code usually behaves correctly, except when it is externally manipulated in malicious ways.
Skutki
Other
Other; Alter Execution Logic
Przykłady podatności
- CVE-2021-3011 virtual interrupt controller in a virtualization product allows crash of host by writing a certain invalid value to a register, which triggers a fatal error instead of returning an error code
Słabość nadrzędna
Słabości podrzędne
Kiedy powstaje
- Implementation — This issue typically appears in rarely-tested code, since the "always-incorrect" nature will be detected as a bug during normal usage.
Dotyczy
Not Language-Specific
Uwagi
This node could possibly be split into lower-level nodes. "Early Return" is for returning control to the caller too soon (e.g., CWE-584). "Excess Return" is when control is returned too far up the call stack (CWE-600, CWE-395). "Improper control limitation" occurs when the product maintains control at a lower level of execution, when control should be returned "further" up the call stack (CWE-455). "Incorrect syntax" covers code that's "just plain wrong" such as CWE-484 and CWE-483.
Wpis z katalogu CWE 4.20.