CWE-190 / WEAKNESS
Integer Overflow or Wraparound
The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.
- Category
- CWE weaknesses
- Version / scope
- CWE 4.20; release 2026-04-30; publisher status Stable
- Affected / relevant technologies
- Not Technology-Specific / Not Language-Specific / C
- Evidence
- Documentation: pinned-source excerpt checked. Execution: not tested. Editorial: curated reference.
Defensive analysis and explicitly authorized assessment only. This website performs no scans, exploitation, model calls or infrastructure changes. Indicators below are investigation opportunities, not proof of compromise or guaranteed detectors.
Mechanism and prerequisites
No separate exploit prerequisites are asserted here; the publisher's weakness/pattern context must be matched to the implementation.
Potential impact
Availability DoS: Crash, Exit, or Restart DoS: Resource Consumption (Memory) DoS: Instability This weakness can generally lead to undefined behavior and therefore crashes. When the calculated result is used for resource allocation, this weakness can cause too many (or too few) resources to be allocated, possibly enabling crashes if the product requests more resources than can be provided. Integrity Modify Memory If the value in question is important to data (as opposed to flow), simple data corruption has occurred. Also, if the overflow/wraparound results in other conditions such as buffer overflows, further memory corruption may occur. Confidentiality Availability Access Control Execute Unauthorized Code or Commands Bypass Protection Mechanism This weakness can sometimes trigger buffer overflows, which can be used to execute arbitrary code. This is usually outside the scope of the product's implicit security policy. Availability Other Alter Execution Logic DoS: Crash, Exit, or Restart DoS: Resource Consumption (CPU) If the overflow/wraparound occurs in a loop index variable, this could cause the loop to terminate at the wrong time - too early, too late, or not at all (i.e., infinite loops). With too many iterations, some loops could consume too many resources such as memory, file handles, etc., possibly leading to a crash or other DoS. Access Control Bypass Protection Mechanism If integer values are used in security-critical decisions, such as calculating quotas or allocation limits, integer overflows can be used to cause an incorrect security decision.
Versioned source scope
This record contains normalized, sometimes shortened source excerpts with editorial safety context. Markup and executable example blocks are omitted. Source-field verification does not establish device testing, a working detector or local applicability.
Publisher: MITRE. Release: CWE 4.20; release 2026-04-30; publisher status Stable. Source checked: 2026-11-18.
Source object: CWE-190. Object modified: 2025-12-11.
Attribution and source terms (© The MITRE Corporation; reproduced with permission)Detection and investigation
- Automated Static Analysis This weakness can often be detected using automated static analysis tools. Many modern tools use data flow analysis or constraint-based techniques to minimize the number of false positives. High
- Black Box Sometimes, evidence of this weakness can be detected using dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results. Moderate Without visibility into the code, black box methods may not be able to sufficiently distinguish this weakness from others, requiring follow-up manual methods to diagnose the underlying problem.
- Manual Analysis This weakness can be detected using tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session. Specifically, manual static analysis is useful for evaluating the correctness of allocation calculations. This can be useful for detecting overflow conditions (CWE-190) or similar weaknesses that might have serious security impacts on the program. High These may be more effective than strictly automated techniques. This is especially the case with weaknesses that are related to design and business rules.
- Automated Static Analysis - Binary or Bytecode According to SOAR [REF-1479], the following detection techniques may be useful: Highly cost effective: Bytecode Weakness Analysis - including disassembler + source code weakness analysis Binary Weakness Analysis - including disassembler + source code weakness analysis High
Preserve source timestamps, asset identity and collection context. Correlate independent evidence before attributing malicious intent. In OT, review passive evidence with the process owner; do not induce failures, replay commands or write to controllers to test a hypothesis.
Mitigation and response
- Requirements Ensure that all protocols are strictly defined, such that all out-of-bounds behavior can be identified simply, and require strict conformance to the protocol.
- Requirements Language Selection Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. If possible, choose a language or compiler that performs automatic bounds checking.
- Architecture and Design Libraries or Frameworks Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482]. Use libraries or frameworks that make it easier to handle numbers without unexpected consequences. Examples include safe integer handling packages such as SafeInt (C++) or IntegerLib (C or C++). [REF-106]
- Implementation Input Validation Perform input validation on any numeric input by ensuring that it is within the expected range. Enforce that the input meets both the minimum and maximum requirements for the expected range. Use unsigned integers where possible. This makes it easier to perform validation for integer overflows. When signed integers are required, ensure that the range check includes minimum values as well as maximum values.
Apply changes through the asset owner's approved change and recovery process. Documentation review is separate from successful testing or verified production protection.
Related technical context
No protocol-specific mapping is asserted for this entry.
Related security reading
Continue directly to another reference. Editorial reading connections do not assert official CWE/CAPEC/ATT&CK/OWASP equivalence or mappings.
Publisher weakness and attack-pattern relationships
These relationships retain the publisher's source attributes and view context; they do not establish that an attack or weakness applies to a particular system.
- CAPEC-92 → Related_Weakness → CWE-190 Open related reference
- CWE-128 → PeerOf → CWE-190 Open related reference
- CWE-1339 → PeerOf → CWE-190 Open related reference
- CWE-190 → Related_Attack_Pattern → CAPEC-92 Open related reference
- CWE-190 → CanPrecede → CWE-119 Open related reference
- CWE-190 → ChildOf → CWE-20 Open related reference
- CWE-190 → ChildOf → CWE-682 Open related reference
- CWE-190 → ChildOf → CWE-682 Open related reference
- CWE-680 → StartsWith → CWE-190 Open related reference
- CWE-680 → ChildOf → CWE-190 Open related reference
Authoritative sources and attribution
Identifiers and source titles belong to OWASP, MITRE, the CVE Program, CISA, NIST or the cited vendor. Source excerpts are attributed and adapted under the linked publisher license; editorial context is separate. This is not an official framework mirror. Review baseline: 2026-11-18. Live documents can change; check exact current applicability.
- Publisher reference: CWE-190 — source accessed 2026-11-18
- cwe — source accessed 2026-11-18
Source review supports bounded reference text. It is not execution evidence, a completeness claim, a CVSS assessment, a compliance certification or verification of production security.
