CWE-703: Improper Check or Handling of Exceptional Conditions
|
Weakness ID: 703
Vulnerability Mapping:
DISCOURAGED
This CWE ID should not be used to map to real-world vulnerabilities
Abstraction:
Pillar
Pillar - a weakness that is the most abstract type of weakness and represents a theme for all class/base/variant weaknesses related to it. A Pillar is different from a Category as a Pillar is still technically a type of weakness that describes a mistake, while a Category represents a common characteristic used to group related things.
|
View customized information:
Shows the description and diagram, platforms, mitigations, consequences, relationships, memberships, and content history.
For users who are interested in more notional aspects of a weakness. Example: educators, technical writers, and project/program managers.
For users who are concerned with the practical application and details about the nature of a weakness and how to prevent it from happening. Example: tool developers, security researchers, pen-testers, incident response analysts.
For users who are mapping an issue to CWE/CAPEC IDs, i.e., finding the most appropriate CWE for a specific issue (e.g., a CVE record). Example: tool developers, security researchers.
For users who wish to see all available information for the CWE/CAPEC entry.
For users who want to customize what details are displayed.
More information is available — Please edit the custom filter or select a different filter.
Description
| The product does not properly anticipate or handle exceptional conditions that rarely occur during normal operation of the product. |
|
Dimensions
The Dimensions table provides information about the
different dimensions associated with this weakness. The Type identifies the dimension type,
while the Value provides the specific value for that dimension.
| Type | Value |
| Behavior-Property | Improper | | Behavior-Type | Check | | Behavior-Type | Handling | | Other | Exceptional Conditions |
Common Consequences
This table specifies different individual consequences
associated with the weakness. The Scope identifies the application security area that is
violated, while the Impact describes the negative technical impact that arises if an
adversary succeeds in exploiting this weakness. The Likelihood provides information about
how likely the specific consequence is expected to be seen relative to the other
consequences in the list. For example, there may be high likelihood that a weakness will be
exploited to achieve a certain impact, but a low likelihood that it will be exploited to
achieve a different impact.
| Impact |
Details |
|
Read Application Data; DoS: Crash, Exit, or Restart; Unexpected State
|
Scope: Confidentiality, Availability, Integrity
|
Relationships
This table shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOf and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition,
relationships such as PeerOf, Overlaps, and CanAlsoBe are defined to show similar weaknesses that the user
may want to explore.
|
Relevant to the view "Complete Weakness Hierarchy" (View-1000)
|
|
Nature |
Type |
ID |
Name |
|
MemberOf |
View - a subset of CWE entries that provides a way of examining CWE content. The two main view structures are Slices (flat lists) and Graphs (containing relationships between entries).
|
1000
|
Complete Weakness Hierarchy
|
|
ParentOf |
Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource.
|
228
|
Improper Handling of Syntactically Invalid Structure
|
|
ParentOf |
Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource.
|
393
|
Return of Wrong Status Code
|
|
ParentOf |
Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource.
|
397
|
Declaration of Throws for Generic Exception
|
|
ParentOf |
Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource.
|
754
|
Improper Check for Unusual or Exceptional Conditions
|
|
ParentOf |
Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource.
|
755
|
Improper Handling of Exceptional Conditions
|
|
ParentOf |
Class - a weakness that is described in a very abstract fashion, typically independent of any specific language or technology. More specific than a Pillar Weakness, but more general than a Base Weakness. Class level weaknesses typically describe issues in terms of 1 or 2 of the following dimensions: behavior, property, and resource.
|
1384
|
Improper Handling of Physical or Environmental Conditions
|
|
|
Relevant to the view "Architectural Concepts" (View-1008)
|
|
Nature |
Type |
ID |
Name |
|
MemberOf |
Grouping - a CWE entry that contains a set of other entries that share a common characteristic.
|
1012
|
Cross Cutting
|
|
|
Relevant to the view "CISQ Quality Measures (2020)" (View-1305)
|
|
Nature |
Type |
ID |
Name |
|
ParentOf |
Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource.
|
248
|
Uncaught Exception
|
|
ParentOf |
Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource.
|
392
|
Missing Report of Error Condition
|
|
|
Relevant to the view "CISQ Data Protection Measures" (View-1340)
|
|
Nature |
Type |
ID |
Name |
|
ParentOf |
Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource.
|
248
|
Uncaught Exception
|
|
ParentOf |
Base - a weakness that is still mostly independent of a resource or technology, but with sufficient details to provide specific methods for detection and prevention. Base level weaknesses typically describe issues in terms of 2 or 3 of the following dimensions: behavior, property, technology, language, and resource.
|
392
|
Missing Report of Error Condition
|
|
Modes
Of Introduction
The different Modes of Introduction provide information
about how and when this
weakness may be introduced. The Phase identifies a point in the life cycle at which
introduction
may occur, while the Note provides a typical scenario related to introduction during the
given
phase.
| Phase(s) |
Note |
|
Architecture and Design
|
|
|
Implementation
|
REALIZATION: This weakness is caused during implementation of an architectural security tactic. |
|
Operation
|
|
Applicable Platforms
This listing shows possible areas for which the given
weakness could appear. These
may be for specific named Languages, Operating Systems, Architectures, Paradigms,
Technologies,
or a class of such platforms. The platform is listed along with how frequently the given
weakness appears for that instance.
| Type |
Applicable Platforms |
Notes |
| Languages |
Class: Not Language-Specific
(Undetermined Prevalence)
Python
(Undetermined Prevalence)
|
|
| Technologies |
Class: Not Technology-Specific
(Undetermined Prevalence)
|
|
Demonstrative Examples
Example 1
Consider the following code segment:
(bad code)
Example Language: C
char buf[10], cp_buf[10]; fgets(buf, 10, stdin); strcpy(cp_buf, buf);
The programmer expects that when fgets() returns, buf will contain a null-terminated string of length 9 or less. But if an I/O error occurs, fgets() will not null-terminate buf. Furthermore, if the end of the file is reached before any characters are read, fgets() returns without writing anything to buf. In both of these situations, fgets() signals that something unusual has happened by returning NULL, but in this code, the warning will not be noticed. The lack of a null terminator in buf can result in a buffer overflow in the subsequent call to strcpy().
Example 2
The following method throws three types of exceptions.
(good code)
Example Language: Java
public void doExchange() throws IOException, InvocationTargetException, SQLException { ... }
While it might seem tidier to write
(bad code)
Example Language: Java
public void doExchange() throws Exception { ... }
doing so hampers the caller's ability to understand and handle the exceptions that occur. Further, if a later revision of doExchange() introduces a new type of exception that should be treated differently than previous exceptions, there is no easy way to enforce this requirement.
Selected Observed
Examples
Note: this is a curated list of examples for users to understand the variety of ways in which this
weakness can be introduced. It is not a complete list of all CVEs that are related to this CWE entry.
| Reference |
Description |
|
|
Chain: JavaScript-based cryptocurrency library can fall back to the insecure Math.random() function instead of reporting a failure ( CWE-392), thus reducing the entropy ( CWE-332) and leading to generation of non-unique cryptographic keys for Bitcoin wallets ( CWE-1391)
|
|
|
Chain: an operating system does not properly process malformed Open Shortest Path First (OSPF) Type/Length/Value Identifiers (TLV) ( CWE-703), which can cause the process to enter an infinite loop ( CWE-835)
|
Weakness Ordinalities
| Ordinality |
Description |
|
Primary
|
(where the weakness exists independent of other weaknesses)
|
|
Resultant
|
(where the weakness is typically related to the presence of some other weaknesses)
|
Detection
Methods
| Method |
Details |
|
Dynamic Analysis with Manual Results Interpretation
|
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
- Fault Injection - source code
- Fault Injection - binary
Cost effective for partial coverage:
Effectiveness: High
|
|
Manual Static Analysis - Source Code
|
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
- Manual Source Code Review (not inspections)
Cost effective for partial coverage:
- Focused Manual Spotcheck - Focused manual analysis of source
Effectiveness: High
|
|
Automated Static Analysis - Source Code
|
According to SOAR [REF-1479], the following detection techniques may be useful:
Cost effective for partial coverage:
- Source code Weakness Analyzer
- Context-configured Source Code Weakness Analyzer
Effectiveness: SOAR Partial
|
|
Architecture or Design Review
|
According to SOAR [REF-1479], the following detection techniques may be useful:
Highly cost effective:
- Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)
- Formal Methods / Correct-By-Construction
Effectiveness: High
|
Vulnerability Mapping Notes
|
Usage
|
DISCOURAGED
(this CWE ID should not be used to map to real-world vulnerabilities)
|
| Reason |
Abstraction
|
|
Rationale
|
This CWE entry is extremely high-level, a Pillar.
|
|
Comments
|
Consider children or descendants of this entry instead.
|
Notes
Relationship
This is a high-level class that might have some overlap with other classes. It could be argued that even "normal" weaknesses such as buffer overflows involve unusual or exceptional conditions. In that sense, this might be an inherent aspect of most other weaknesses within CWE, similar to API Abuse ( CWE-227) and Indicator of Poor Code Quality ( CWE-398). However, this entry is currently intended to unify disparate concepts that do not have other places within the Research Concepts view ( CWE-1000).
Taxonomy
Mappings
| Mapped Taxonomy Name |
Node ID |
Fit |
Mapped Node Name |
| The CERT Oracle Secure Coding Standard for Java (2011) |
ERR06-J |
|
Do not throw undeclared checked exceptions |
| OpenSSF Secure Coding Guide for Python |
pyscg-0034 |
|
Check for None Values |
Content
History
| Submissions |
| Submission Date |
Submitter |
Organization |
2008-09-09
(CWE 1.0, 2008-09-09)
|
CWE Content Team |
MITRE |
|
Note: this date reflects when the entry was first published. Draft versions of this entry were provided to members of the CWE community and modified between Draft 9 and 1.0.
|
| Modifications |
| Modification Date |
Modifier |
Organization |
2026-10-28
(CWE 5.0, 2026-10-28)
|
CWE Content Team |
MITRE |
|
updated Applicable_Platforms, Dimensions, References, Relationships, Taxonomy_Mappings
|
2025-12-11
(CWE 4.19, 2025-12-11)
|
CWE Content Team |
MITRE |
|
updated Diagram, Relationships, Weakness_Ordinalities
|
2025-09-09
(CWE 4.18, 2025-09-09)
|
CWE Content Team |
MITRE |
|
updated Detection_Factors, References
|
2025-04-03
(CWE 4.17, 2025-04-03)
|
CWE Content Team |
MITRE |
|
updated Demonstrative_Examples
|
2024-02-29
(CWE 4.14, 2024-02-29)
|
CWE Content Team |
MITRE |
|
updated Demonstrative_Examples, Observed_Examples, References, Relationships
|
2023-10-26
(CWE 4.13, 2023-10-26)
|
CWE Content Team |
MITRE |
|
updated Observed_Examples
|
2023-06-29
(CWE 4.12, 2023-06-29)
|
CWE Content Team |
MITRE |
|
updated Mapping_Notes, Relationships
|
2023-04-27
(CWE 4.11, 2023-04-27)
|
CWE Content Team |
MITRE |
|
updated References, Relationships
|
2023-01-31
(CWE 4.10, 2023-01-31)
|
CWE Content Team |
MITRE |
|
updated Description, Relationships
|
2022-04-28
(CWE 4.7, 2022-04-28)
|
CWE Content Team |
MITRE |
|
updated Relationships
|
2021-10-28
(CWE 4.6, 2021-10-28)
|
CWE Content Team |
MITRE |
|
updated Relationships
|
2021-07-20
(CWE 4.5, 2021-07-20)
|
CWE Content Team |
MITRE |
|
updated Relationships
|
2020-12-10
(CWE 4.3, 2020-12-10)
|
CWE Content Team |
MITRE |
|
updated Relationships
|
2020-08-20
(CWE 4.2, 2020-08-20)
|
CWE Content Team |
MITRE |
|
updated Relationships
|
2020-02-24
(CWE 4.0, 2020-02-24)
|
CWE Content Team |
MITRE |
|
updated Applicable_Platforms, Relationships, Type
|
2019-06-20
(CWE 3.3, 2019-06-20)
|
CWE Content Team |
MITRE |
|
updated Relationships
|
2019-01-03
(CWE 3.2, 2019-01-03)
|
CWE Content Team |
MITRE |
|
updated Relationships, Taxonomy_Mappings
|
2017-11-08
(CWE 3.0, 2017-11-08)
|
CWE Content Team |
MITRE |
|
updated Applicable_Platforms, Modes_of_Introduction, References, Relationships, Taxonomy_Mappings
|
2017-01-19
(CWE 2.10, 2017-01-19)
|
CWE Content Team |
MITRE |
|
updated Relationships
|
2014-07-30
(CWE 2.8, 2014-07-31)
|
CWE Content Team |
MITRE |
|
updated Detection_Factors, Relationships
|
2012-05-11
(CWE 2.2, 2012-05-15)
|
CWE Content Team |
MITRE |
|
updated References, Relationships, Taxonomy_Mappings
|
2011-09-13
(CWE 2.1, 2011-09-13)
|
CWE Content Team |
MITRE |
|
updated Relationships, Taxonomy_Mappings
|
2011-06-27
(CWE 2.0, 2011-06-27)
|
CWE Content Team |
MITRE |
|
updated Common_Consequences
|
2011-06-01
(CWE 1.13, 2011-06-01)
|
CWE Content Team |
MITRE |
|
updated Common_Consequences, Relationships, Taxonomy_Mappings
|
2011-03-29
(CWE 1.12, 2011-03-30)
|
CWE Content Team |
MITRE |
|
updated Relationships
|
2010-12-13
(CWE 1.11, 2010-12-13)
|
CWE Content Team |
MITRE |
|
updated Name, Relationship_Notes
|
2010-02-16
(CWE 1.8, 2010-02-16)
|
CWE Content Team |
MITRE |
|
updated Relationships
|
2009-10-29
(CWE 1.6, 2009-10-29)
|
CWE Content Team |
MITRE |
|
updated Other_Notes
|
2009-03-10
(CWE 1.3, 2009-03-10)
|
CWE Content Team |
MITRE |
|
updated Relationships
|
2008-07-01
(CWE 1.0, 2008-09-09)
|
Eric Dalci |
Cigital |
|
updated Time_of_Introduction
|
| Previous Entry Names |
| Change Date |
Previous Entry Name |
| 2010-12-13
|
Failure to Handle Exceptional Conditions |
More information is available — Please edit the custom filter or select a different filter.
|