CWEweakness

CWE-754 Improper Check for Unusual or Exceptional Conditions

Medium Official page ↗
Abstraction
Class
Structure
Simple
Status
Incomplete
Likelihood of exploit
Medium
Languages
Not Language-Specific, Python
CWE version
5.0

Description

The product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product.

Common consequences

• Integrity, Availability: DoS: Crash, Exit, or Restart, Unexpected State — This could lead to instability, incorrect behavior, or a vulnerability. Any data that was produced as a result of a function call could be in a bad state upon return. If the return value is not checked, then this bad data may be used in operations, possibly leading to a crash or other unintended behaviors.

Potential mitigations

• [Requirements] Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Choose languages with features such as exception handling that force the programmer to anticipate unusual conditions that may generate exceptions. Custom exceptions may need to be developed to handle unusual business-logic conditions. Be careful not to pass sensitive exceptions back to the user (CWE-209, CWE-248). • [Implementation] Check the results of all functions that return a value and verify that the value is expected. • [Implementation] If using exception handling, catch and throw specific exceptions instead of overly-general exceptions (CWE-396, CWE-397). Catch and handle exceptions as locally as possible so that exceptions do not propagate too far up the call stack (CWE-705). Avoid unchecked or uncaught exceptions where feasible (CWE-248). • [Implementation] Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success. If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files. Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not. Exposing additional information to a potential attacker in the context of an exceptional condition can help the attacker determine what attack vectors are most likely to succeed beyond DoS. • [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright. • [Architecture and Design, Implementation] If the program must fail, ensure that it fails gracefully (fails closed). There may be a temptation to simply let the program fail poorly in cases such as low memory conditions, but an attacker may be able to assert control before the software has fully exited. Alternately, an uncontrolled failure could cause cascading problems with other downstream components; for example, the program could send a signal to a downstream process so the process immediately knows that a problem has occurred and has a better chance of recovery. • [Architecture and Design] Use system limits, which should help to prevent resource exhaustion. However, the product should still handle low resource conditions since they may still occur.

Detection methods

• Automated Static Analysis: Automated static analysis may be useful for detecting unusual conditions involving system resources or common programming idioms, but not for violations of business rules. • Manual Dynamic Analysis: Identify error conditions that are not likely to occur during normal usage and trigger them. For example, run the program under low memory conditions, run with insufficient privileges or permissions, interrupt a transaction before it is completed, or disable connectivity to basic network services such as DNS. Monitor the software for any unexpected behavior. If you trigger an unhandled exception or similar error that was discovered and handled by the application's environment, it may still indicate unexpected conditions that were not handled by the application itself.

Observed examples

• 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) • 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.

Related

Observed example · CVE (4)

  • CVE-2023-49286 Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. 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

Can precede · CWE (1)

Child of · CWE (1)

  • CWE-703 Improper Check or Handling of Exceptional Conditions weakness

Referenced by CVE · weakness (679)

  • CVE-2026-119126 Parse Server before 8.6.106 and 9.0.0 before 9.10.5-alpha.7 mishandles dot notation keys with null or undefined values when building the… vulnerability
  • CVE-2026-62374 SD JWT JS is a JavaScript implementation of the Selective Disclosure JWT (SD-JWT) specification. vulnerability
  • CVE-2026-116516 Mattermost versions <=11.9 11.1.9 11.5.8 11.10.7.0 fail to validate Zoom chat line length before slicing which allows an authenticated… vulnerability
  • CVE-2026-115385 Wasmtime 46.0.0 before 48.0.4 and 49.0.0 before 49.0.2 contains a denial of service vulnerability in the wasmtime-wasi WASIp3… vulnerability
  • CVE-2026-13411 Mattermost versions 11.7.x <= 11.7.11 fail to validate null elements when decoding playbook import conditions which allows an authenticated… vulnerability
  • CVE-2026-113380 In the RingRTC library before 2.72.0 for Signal, a peer that saturates a call's FSM queue can interfere with the ability of a local hangup… 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-100352 kin-openapi is a Go project for handling OpenAPI files. vulnerability
  • CVE-2026-109855 undici is an HTTP client library for Node.js. vulnerability
  • CVE-2026-0317 A denial of service vulnerability in Palo Alto Networks PAN-OS software enables an authenticated user with a read-only administrator role… vulnerability
  • CVE-2026-0318 A stack-based buffer overflow vulnerability in the log processing functionality of Palo Alto Networks PAN-OS® software on Panorama enables… vulnerability
  • CVE-2026-0319 An improper input handling vulnerability in the GlobalProtect™ gateway of Palo Alto Networks PAN-OS software enables an authenticated user… vulnerability
  • CVE-2026-0321 Denial of service vulnerabilities in Palo Alto Networks PAN-OS® software allow an unauthenticated attacker with network access to cause a… vulnerability
  • CVE-2026-102077 An Improper Check for Unusual or Exceptional Conditions vulnerability in the Packet Forwarding Engine (PFE) of Juniper Networks Junos OS on… vulnerability
  • CVE-2026-67416 RabbitMQ is a messaging and streaming broker. vulnerability
  • CVE-2026-78017 Dell Secure Connect Gateway (SCG) Policy Manager, versions prior to 5.34.00.16, contains an Improper Check for Unusual or Exceptional… vulnerability
  • CVE-2026-107275 @fastify/jwt is a JSON Web Token plugin for the Fastify web framework. vulnerability
  • CVE-2026-106562 Backstage is an open framework for building developer portals. vulnerability
  • CVE-2026-106343 Improper state validation in Autofill AI in Google Chrome on on Android prior to 155.0.8059.39 allowed a remote attacker to spoof UI… vulnerability
  • CVE-2026-106346 Improper state validation in DevTools in Google Chrome prior to 155.0.8059.39 allowed a remote attacker to potentially execute arbitrary… vulnerability
  • CVE-2026-104432 Zebra before 6.3.0 contains an improper exceptional condition check in ChainSync::obtain_tips that discards valid one-hash FindBlocks… vulnerability
  • CVE-2026-100296 In Anjvision YSSD-RTMP-H5 firmware version 3.3.2.4, an empty-body POST to /setUserConfig, dispatched through the web server's SOAP-RPC… vulnerability
  • CVE-2026-95330 Improper state validation in Downloads in Google Chrome prior to 154.0.8037.57 allowed a remote attacker to bypass system access… vulnerability
  • CVE-2026-98148 In the Linux kernel, the following vulnerability has been resolved: drm/gud: validate GUD_ROTATION_0 is present in supported rotations The… vulnerability
  • CVE-2026-98161 In the Linux kernel, the following vulnerability has been resolved: nvdimm: pmem: keep PREFLUSH before data writes pmem_submit_bio()… vulnerability
  • CVE-2026-73549 Envoy is an open source edge and service proxy designed for cloud-native applications. vulnerability
  • CVE-2026-94105 NivoCart through 2.4.0 contains a destructive configuration write vulnerability in the admin password reset controller that allows… vulnerability
  • CVE-2026-93387 Improper state validation in Skia in Google Chrome prior to 153.0.8010.52 allowed a remote attacker to obtain cross-origin data via a… vulnerability
  • CVE-2026-77411 RabbitMQ amqp091-go is a Go AMQP 0.9.1 client. vulnerability
  • CVE-2026-91733 Improper state validation in Skia in Google Chrome prior to 153.0.8010.47 allowed a remote attacker who had compromised the renderer… vulnerability
Show all 679 ›

Referenced by CWE · child of (6)

  • CWE-252 Unchecked Return Value weakness
  • CWE-253 Incorrect Check of Function Return Value weakness
  • CWE-273 Improper Check for Dropped Privileges weakness
  • CWE-354 Improper Validation of Integrity Check Value weakness
  • CWE-394 Unexpected Status Code or Return Value weakness
  • CWE-476 NULL Pointer Dereference weakness

Referenced by CWE · has member (2)

  • CWE-1003 Weaknesses for Simplified Mapping of Published Vulnerabilities view
  • CWE-1460 Weaknesses Addressed by the Top 20 Secure PLC Coding Practices view

Referenced by OWASP · mapped cwe (1)

  • A10:2025 Mishandling of Exceptional Conditions Top 10 2025