CWE-253: Incorrect Check of Function Return Value

BaseIncompleteExploit Likelihood: Low

The product incorrectly checks a return value from a function, which prevents it from detecting errors or exceptional conditions.

View on MITRE
Back to CWE Lookup

Extended Description

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.

Technical Details

Structure
Simple

Applicable To

Languages
Not Language-Specific
Platforms

Frequently Asked Questions

What is CWE-253: Incorrect Check of Function Return Value?+

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.

What are the security consequences of Incorrect Check of Function Return Value?+

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.

How do you prevent or mitigate Incorrect Check of Function Return Value?+

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.

Which programming languages are affected by Incorrect Check of Function Return Value?+

CWE-253 commonly affects Not Language-Specific. Note that weaknesses are often language-agnostic patterns, so secure coding practices apply broadly.

What are real-world examples of Incorrect Check of Function Return Value?+

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.

What is the difference between a CWE and a CVE?+

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.

Learn More