The product incorrectly checks a return value from a function, which prevents it from detecting errors or exceptional conditions.
View on MITREImportant 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.
An unexpected return value could place the system in a state that could lead to a crash or other unintended behaviors.
Use a language or compiler that uses exceptions and requires the catching of those exceptions.
Properly check all functions which return a value.
When designing any function make sure you return a value or throw an exception in case of an error.
No detection method information available for this CWE.
This code attempts to allocate memory for 4 integers and checks if the allocation succeeds.
The code assumes that only a negative return value would indicate an error, but malloc() may return a null pointer when there is an error. The value of tmp could then be equal to 0, and the error would be missed.
Chain: function in web caching proxy does not correctly check a return value (CWE-253) leading to a reachable assertion (CWE-617)
View DetailsNo relationship information available for this CWE.
CWE-253: Incorrect Check of Function Return Value is a Common Weakness Enumeration (CWE) entry maintained by MITRE. 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.
If exploited, CWE-253 (Incorrect Check of Function Return Value) it can compromise Availability and Integrity, leading to outcomes such as Unexpected State and DoS: Crash, Exit, or Restart.
Recommended mitigations for CWE-253 include: Use a language or compiler that uses exceptions and requires the catching of those exceptions. Properly check all functions which return a value. When designing any function make sure you return a value or throw an exception in case of an error.
CWE-253 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.
MITRE documents real CVEs mapped to CWE-253, including CVE-2023-49286. You can look up the full details of each CVE, including CVSS scores and remediation guidance, on our CVE Lookup tool.
A CWE (Common Weakness Enumeration) like CWE-253 describes a category of software weakness — the underlying flaw type. A CVE (Common Vulnerabilities and Exposures) identifies a specific, real-world vulnerability in a particular product. In short, a CWE is the kind of mistake, and a CVE is an instance of that mistake being found in software.