CWE-391: Unchecked Error Condition

Base Incomplete Simple

CWE版本: 4.18

更新日期: 2025-09-09

弱点描述

[PLANNED FOR DEPRECATION. SEE MAINTENANCE NOTES AND CONSIDER CWE-252, CWE-248, OR CWE-1069.] Ignoring exceptions and other error conditions may allow an attacker to induce unexpected behavior unnoticed.

常见后果

影响范围: Integrity Other

技术影响: Varies by Context Unexpected State Alter Execution Logic

潜在缓解措施

阶段: Requirements

描述: The choice between a language which has named or unnamed exceptions needs to be done. While unnamed exceptions exacerbate the chance of not properly dealing with an exception, named exceptions suffer from the up call version of the weak base class problem.

阶段: Requirements

描述: A language can be used which requires, at compile time, to catch all serious exceptions. However, one must make sure to use the most current version of the API as new exceptions could be added.

阶段: Implementation

描述: Catch all relevant exceptions. This is the recommended solution. Ensure that all exceptions are handled in such a way that you can be sure of the state of your system at any given moment.

检测方法

方法: 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.)

有效性: High

引入模式

阶段 说明
Implementation REALIZATION: This weakness is caused during implementation of an architectural security tactic.

适用平台

编程语言
Not Language-Specific (Undetermined)

分类映射

分类名称 条目ID 条目名称 映射适配度
PLOVER - Unchecked Return Value -
7 Pernicious Kingdoms - Empty Catch Block -
CLASP - Uncaught exception -
OWASP Top Ten 2004 A7 Improper Error Handling CWE More Specific
CERT C Secure Coding ERR00-C Adopt and implement a consistent and comprehensive error-handling policy -
CERT C Secure Coding ERR33-C Detect and handle standard library errors CWE More Abstract
CERT C Secure Coding ERR34-C Detect errors when converting a string to a number CWE More Abstract
CERT C Secure Coding FLP32-C Prevent or detect domain and range errors in math functions Imprecise
CERT C Secure Coding POS54-C Detect and handle POSIX library errors CWE More Abstract
SEI CERT Perl Coding Standard EXP31-PL Do not suppress or ignore exceptions Imprecise
Software Fault Patterns SFP4 Unchecked Status Condition -
关键信息

CWE ID: CWE-391

抽象级别: Base

结构: Simple

状态: Incomplete

利用可能性: Medium

相关弱点