Modes Of Introduction
Implementation
Applicable Platforms
Language
Name: C (Undetermined)
Name: C++ (Undetermined)
Name: Java (Undetermined)
Name: C# (Undetermined)
Common Consequences
Scope |
Impact |
Likelihood |
Integrity | Modify Memory
Note: The true value of the data is lost and corrupted data is used. | |
Observed Examples
References |
Description |
| Chain: integer truncation (CWE-197) causes small buffer allocation (CWE-131) leading to out-of-bounds write (CWE-787) in kernel pool, as exploited in the wild per CISA KEV. |
| Integer truncation of length value leads to heap-based buffer overflow. |
| Size of a particular type changes for 64-bit platforms, leading to an integer truncation in document processor causes incorrect index to be generated. |
Potential Mitigations
Phases : Implementation
Ensure that no casts, implicit or explicit, take place that move from a larger size primitive or a smaller size primitive.
Detection Methods
Fuzzing
Fuzz testing (fuzzing) is a powerful technique for generating large numbers of diverse inputs - either randomly or algorithmically - and dynamically invoking the code with those inputs. Even with random inputs, it is often capable of generating unexpected results such as crashes, memory corruption, or resource consumption. Fuzzing effectively produces repeatable test cases that clearly indicate bugs, which helps developers to diagnose the issues.
Effectiveness : High
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.)
Effectiveness : High
Vulnerability Mapping Notes
Justification : This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Comment : Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.
NotesNotes
This weakness has traditionally been under-studied and under-reported, although vulnerabilities in popular software have been published in 2008 and 2009.
References
REF-62
The Art of Software Security Assessment
Mark Dowd, John McDonald, Justin Schuh.
Submission
Name |
Organization |
Date |
Date release |
Version |
PLOVER |
|
2006-07-19 +00:00 |
2006-07-19 +00:00 |
Draft 3 |
Modifications
Name |
Organization |
Date |
Comment |
CWE Content Team |
MITRE |
2008-09-08 +00:00 |
updated Applicable_Platforms, Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings |
CWE Content Team |
MITRE |
2008-11-24 +00:00 |
updated Relationships, Taxonomy_Mappings |
CWE Content Team |
MITRE |
2009-05-27 +00:00 |
updated Demonstrative_Examples |
CWE Content Team |
MITRE |
2009-07-27 +00:00 |
updated Description, Observed_Examples, Other_Notes, Research_Gaps |
CWE Content Team |
MITRE |
2010-12-13 +00:00 |
updated Demonstrative_Examples |
CWE Content Team |
MITRE |
2011-06-01 +00:00 |
updated Common_Consequences, Relationships, Taxonomy_Mappings |
CWE Content Team |
MITRE |
2011-09-13 +00:00 |
updated Relationships, Taxonomy_Mappings |
CWE Content Team |
MITRE |
2012-05-11 +00:00 |
updated References, Relationships, Taxonomy_Mappings |
CWE Content Team |
MITRE |
2014-07-30 +00:00 |
updated Relationships, Taxonomy_Mappings |
CWE Content Team |
MITRE |
2017-11-08 +00:00 |
updated Taxonomy_Mappings |
CWE Content Team |
MITRE |
2019-01-03 +00:00 |
updated Relationships, Taxonomy_Mappings |
CWE Content Team |
MITRE |
2020-02-24 +00:00 |
updated Relationships |
CWE Content Team |
MITRE |
2020-08-20 +00:00 |
updated Relationships |
CWE Content Team |
MITRE |
2020-12-10 +00:00 |
updated Relationships |
CWE Content Team |
MITRE |
2022-06-28 +00:00 |
updated Observed_Examples |
CWE Content Team |
MITRE |
2023-04-27 +00:00 |
updated Detection_Factors, Relationships |
CWE Content Team |
MITRE |
2023-06-29 +00:00 |
updated Mapping_Notes |