CWE-253 · Słabość
Incorrect Check of Function Return Value
- Abstrakcja
- Bazowa
- Status
- Niekompletny
- Ryzyko wykorzystania
- niskie
- Dodano
- 19 lipca 2006
- Ostatnia zmiana
- 11 grudnia 2025
Opis
The product incorrectly checks a return value from a function, which prevents it from detecting errors or exceptional conditions.
Important and common functions will return some value about the success of its actions. This will alert the program whether or not to handle any errors caused by that function.
Skutki
Availability, Integrity
Unexpected State; DoS: Crash, Exit, or Restart
An unexpected return value could place the system in a state that could lead to a crash or other unintended behaviors.
Zapobieganie
Architecture and Design · Language Selection
Use a language or compiler that uses exceptions and requires the catching of those exceptions.
Implementation
Properly check all functions which return a value.
Implementation
When designing any function make sure you return a value or throw an exception in case of an error.
Przykłady podatności
- CVE-2023-49286 Chain: function in web caching proxy does not correctly check a return value (CWE-253) leading to a reachable assertion (CWE-617)
Słabość nadrzędna
Kiedy powstaje
- Implementation
Dotyczy
Not Language-Specific, Not Technology-Specific
Źródła
- The Art of Software Security Assessment — Mark Dowd, John McDonald, Justin Schuh, Chapter 7, "Return Value Testing and Interpretation", Page 340, Addison Wesley, 2006
- The CLASP Application Security Process — Secure Software, Inc., 2005
Wpis z katalogu CWE 4.20.