CWEweakness
CWE-252 Unchecked Return Value
Low
Official page ↗
- Abstraction
- Base
- Structure
- Simple
- Status
- Draft
- Likelihood of exploit
- Low
- Languages
- Not Language-Specific, Python
- CWE version
- 5.0
Description
The product does not check the return value from a method or function.
Common consequences
• Availability, Integrity: Unexpected State, Varies by Context, DoS: Crash, Exit, or Restart — The product could be prevented from detecting unexpected states and conditions, placing the product into a state that could lead to a crash or other unintended behaviors.
• Access Control: Bypass Protection Mechanism — If the method/function is used for a protection mechanism, then an unchecked return value could prevent the code from being able to see if the protection mechanism fails. For example, if the program calls a function to drop privileges but does not check the return code to ensure that privileges were successfully dropped, then the program will continue to operate with the higher privileges.
Potential mitigations
• [Implementation] Check the results of all functions that return a value and verify that the value is expected.
• [Implementation] For any pointers that could have been modified or provided from a function that can return NULL, check the pointer for NULL before use. When working with a multithreaded or otherwise asynchronous environment, ensure that proper locking APIs are used to lock before the check, and unlock when it has finished [REF-1484].
• [Implementation] Ensure that you account for all possible return values from the function.
• [Implementation] When designing a function, make sure you return a value or throw an exception in case of an error.
Detection methods
• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Observed examples
• CVE-2020-17533: Chain: unchecked return value (CWE-252) of some functions for policy enforcement leads to authorization bypass (CWE-862)
• CVE-2020-6078: Chain: The return value of a function returning a pointer is not checked for success (CWE-252) resulting in the later use of an uninitialized variable (CWE-456) and a null pointer dereference (CWE-476)
• CVE-2019-15900: Chain: sscanf() call is used to check if a username and group exists, but the return value of sscanf() call is not checked (CWE-252), causing an uninitialized variable to be checked (CWE-457), returning success to allow authorization bypass for executing a privileged (CWE-863).
• CVE-2007-3798: Unchecked return value leads to resultant integer overflow and code execution.
• CVE-2006-4447: Program does not check return value when invoking functions to drop privileges, which could leave users with higher privileges than expected by forcing those functions to fail.
• CVE-2006-2916: Program does not check return value when invoking functions to drop privileges, which could leave users with higher privileges than expected by forcing those functions to fail.
• CVE-2008-5183: Chain: unchecked return value can lead to NULL dereference
• CVE-2010-0211: Chain: unchecked return value (CWE-252) leads to free of invalid, uninitialized pointer (CWE-824).
• CVE-2017-6964: Linux-based device mapper encryption program does not check the return value of setuid and setgid allowing attackers to execute code with unintended privileges.
• CVE-2002-1372: Chain: Return values of file/socket operations are not checked (CWE-252), allowing resultant consumption of file descriptors (CWE-772).
Related
Observed example · CVE (10)
- CVE-2020-17533 Apache Accumulo versions 1.5.0 through 1.10.0 and version 2.0.0 do not properly check the return value of some policy enforcement functions… vulnerability
- CVE-2020-6078 An exploitable denial-of-service vulnerability exists in the message-parsing functionality of Videolabs libmicrodns 0.1.0. vulnerability
- CVE-2019-15900 An issue was discovered in slicer69 doas before 6.2 on certain platforms other than OpenBSD. vulnerability
- CVE-2017-6964 dmcrypt-get-device, as shipped in the eject package of Debian and Ubuntu, does not check the return value of the (1) setuid or (2) setgid… vulnerability
- CVE-2010-0211 The slap_modrdn2mods function in modrdn.c in OpenLDAP 2.4.22 does not check the return value of a call to the smr_normalize function, which… vulnerability
- CVE-2008-5183 cupsd in CUPS 1.3.9 and earlier allows local users, and possibly remote attackers, to cause a denial of service (daemon crash) by adding a… vulnerability
- CVE-2007-3798 Integer overflow in print-bgp.c in the BGP dissector in tcpdump 3.9.6 and earlier allows remote attackers to execute arbitrary code via… vulnerability
- CVE-2006-4447 X.Org and XFree86, including libX11, xdm, xf86dga, xinit, xload, xtrans, and xterm, does not check the return values for setuid and seteuid… vulnerability
- CVE-2006-2916 artswrapper in aRts, when running setuid root on Linux 2.6.0 or later versions, does not check the return value of the setuid function… vulnerability
- CVE-2002-1372 Common Unix Printing System (CUPS) 1.1.14 through 1.1.17 does not properly check the return values of various file and socket operations,… vulnerability
Can precede · CWE (1)
- CWE-476 NULL Pointer Dereference weakness
Child of · CWE (1)
- CWE-754 Improper Check for Unusual or Exceptional Conditions weakness
Referenced by CVE · weakness (203)
- CVE-2026-118263 Echo is a Go web framework. vulnerability
- CVE-2026-110353 HAProxy 3.2 before 3.4.6 allows a remote unauthenticated attacker to cause a denial of service (worker-thread CPU exhaustion) via a… vulnerability
- CVE-2026-111497 A buffer overflow vulnerability in the Brotli decoder (c/dec/decode.c) in Google Brotli versions 1.0.3 through 1.2.0 on all platforms… vulnerability
- CVE-2026-56388 The Redis server command parser in Apache bRPC accepts an empty RESP array as a command header. vulnerability
- CVE-2026-48503 libIEC61850 is an open-source implementation of IEC 61850 client and server protocols including MMS, GOOSE, Sampled Values, and R-Session. vulnerability
- CVE-2026-48741 libIEC61850 is an open-source implementation of IEC 61850 client and server protocols including MMS, GOOSE, Sampled Values, and R-Session. vulnerability
- CVE-2026-77207 Libreswan has a null pointer dereference bug in the PKCS#7 handling code for IKE certificate authentication. vulnerability
- CVE-2026-107785 Crux Agent from 1.9.0 before 2.0.3 uses the full SKA bilocation key as the WireGuard preshared key. vulnerability
- CVE-2026-107838 RIOT is an open-source microcontroller operating system designed for Internet of Things devices and other embedded systems. vulnerability
- CVE-2026-106436 The BSON encoder in the MongoDB PHP Driver does not check some return values after a document exceeds libbson's size limit. vulnerability
- CVE-2026-18397 This vulnerability enables unauthenticated remote code execution (RCE) on a victim's machine by exploiting a combination of cryptographic… vulnerability
- CVE-2026-95316 Unchecked return value in Performance in Google Chrome prior to 154.0.8037.57 allowed a local attacker to potentially read memory via a… vulnerability
- CVE-2026-67409 RabbitMQ is a messaging and streaming broker. vulnerability
- CVE-2026-98114 In the Linux kernel, the following vulnerability has been resolved: ksmbd: propagate DACL parsing errors parse_dacl() silently accepts… vulnerability
- CVE-2026-98141 In the Linux kernel, the following vulnerability has been resolved: ntfs: propagate reparse index insertion failure update_reparse_data()… vulnerability
- CVE-2026-71180 Dell Update Package Framework, versions prior to 26.07.03, contains an Unchecked Return Value vulnerability. vulnerability
- CVE-2026-90648 wasm2c in WebAssembly wabt through 1.0.41 allows sandbox escape in some situations that primarily involve 32-bit platforms, aka a "table… vulnerability
- CVE-2026-86739 Snipe-IT 8.6.3 and earlier do not check the return value of Storage::put() when writing the signature PNG and the generated acceptance PDF… vulnerability
- CVE-2026-86749 Snipe-IT versions <= 8.6.3 (fixed in 8.7.0) do not check the return value of storage write operations in ImageUploadRequest::handleImages(). vulnerability
- CVE-2026-86141 xmlregexp in libxml2 before 2.15.4 has a NULL pointer dereference in xmlRegNewParserCtxt after a strdup failure, i.e., it does not… vulnerability
- CVE-2026-19534 undici's WebSocket client crashes the whole Node.js process during the opening handshake when a server responds with a subprotocol that the… vulnerability
- CVE-2026-85649 (Holloway) Chew, Kean Ho's Actualizer v1.2.0 and earlier contains a fail-open password validation vulnerability in the Alpha user and root… vulnerability
- CVE-2026-14957 In FIPS mode, Libreswan's add_decoded_cert() function calls CERT_ExtractPublicKey() and asserts that the result is not NULL. vulnerability
- CVE-2026-78699 Unchecked Return Value vulnerability in ash-project ash_postgres allows a user who can drive a tenant rename to a name that collides with… vulnerability
- CVE-2026-79772 Nokogiri versions before 1.19.1 fail to check the return value from xmlC14NExecute in the canonicalize method, returning an empty string on… vulnerability
- CVE-2026-77641 tor before 0.4.9.9 was prone to a NULL write after free when sending a CONFLUX_SWITCH cell fails. vulnerability
- CVE-2026-47245 MyBB is free and open source forum software. vulnerability
- CVE-2026-62909 Uncaught exception in .NET allows an authorized attacker to elevate privileges locally. vulnerability
- CVE-2026-26080 HAProxy Community Edition 3.2.x through 3.3.x before 3.3.3 can enter a loop or crash because varint is mishandled. vulnerability
- CVE-2026-64040 In the Linux kernel, the following vulnerability has been resolved: cachefiles: Fix error return when vfs_mkdir() fails When vfs_mkdir()… vulnerability
Referenced by CWE · child of (1)
- CWE-690 Unchecked Return Value to NULL Pointer Dereference weakness
Referenced by CWE · has member (1)
- CWE-884 CWE Cross-section view
Referenced by CWE · peer of (1)
- CWE-273 Improper Check for Dropped Privileges weakness
Referenced by CWE · starts with (1)
- CWE-690 Unchecked Return Value to NULL Pointer Dereference weakness
Referenced by OWASP · mapped cwe (1)
- A10:2025 Mishandling of Exceptional Conditions Top 10 2025