Chi tiết CWE-128

CWE-128

Wrap-around Error
2006-07-19
00h00 +00:00
Trung bình
Incomplete
2026-10-28
00h00 +00:00
Thông báo cho một CWE
Luôn được thông báo về mọi thay đổi đối với một CWE cụ thể.
Quản lý thông báo

Tên: Wrap-around Error

Wrap around errors occur whenever a value is incremented past the maximum value for its type and therefore "wraps around" to a very small, negative, or undefined value.

Thông tin chung

Chi tiết nền tảng

Các cách xuất hiện

Implementation

Nền tảng áp dụng

Ngôn ngữ

Tên: C (Often)
Tên: C++ (Often)

Hậu quả phổ biến

Phạm vi Tác động Khả năng xảy ra
AvailabilityDoS: Crash, Exit, or Restart, DoS: Resource Consumption (CPU), DoS: Resource Consumption (Memory), DoS: Instability

Ghi chú: This weakness will generally lead to undefined behavior and therefore crashes. In the case of overflows involving loop index variables, the likelihood of infinite loops is also high.
IntegrityModify Memory

Ghi chú: If the value in question is important to data (as opposed to flow), simple data corruption has occurred. Also, if the wrap around 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

Ghi chú: This weakness can sometimes trigger buffer overflows which can be used to execute arbitrary code. This is usually outside the scope of a program's implicit security policy.

Các biện pháp giảm thiểu tiềm năng

Requirements specification: The choice could be made to use a language that is not susceptible to these issues.
Phases : Architecture and Design
Provide clear upper and lower bounds on the scale of any protocols designed.
Phases : Implementation
Perform validation on all incremented variables to ensure that they remain within reasonable bounds.

Phương pháp phát hiện

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.)
Hiệu quả : High

Ghi chú ánh xạ lỗ hổng

Lý do : 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.
Bình luận : 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.

Mẫu tấn công liên quan

ID CAPEC Tên mẫu tấn công
CAPEC-92 Forced Integer Overflow
This attack forces an integer variable to go out of range. The integer variable is often used as an offset such as size of memory allocation or similarly. The attacker would typically control the value of such variable and try to get it out of range. For instance the integer in question is incremented past the maximum possible value, it may wrap to become a very small, or negative number, therefore providing a very incorrect value which can lead to unexpected behavior. At worst the attacker can execute arbitrary code.

Ghi chú

The relationship between overflow and wrap-around needs to be examined more closely, since several entries (including CWE-190) are closely related.

Tài liệu tham khảo

REF-44

24 Deadly Sins of Software Security
Michael Howard, David LeBlanc, John Viega.

REF-62

The Art of Software Security Assessment
Mark Dowd, John McDonald, Justin Schuh.

REF-18

The CLASP Application Security Process
Secure Software, Inc..
https://cwe.mitre.org/documents/sources/TheCLASPApplicationSecurityProcess.pdf

REF-1550

Secure PLC Coding Practices: Top 20 List
Secure PLC Programming project.
https://plc-security.com/

Gửi

Tên Tổ chức Ngày Ngày phát hành Version
CLASP 2006-07-19 +00:00 2006-07-19 +00:00 Draft 3

Sửa đổi

Tên Tổ chức Ngày Bình luận
CWE Content Team MITRE 2008-09-08 +00:00 updated Applicable_Platforms, Background_Details, Common_Consequences, Relationships, Relationship_Notes, Taxonomy_Mappings, Weakness_Ordinalities
CWE Content Team MITRE 2008-11-24 +00:00 updated Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2009-10-29 +00:00 updated Common_Consequences, Relationships
CWE Content Team MITRE 2010-12-13 +00:00 updated Background_Details
CWE Content Team MITRE 2011-06-01 +00:00 updated Common_Consequences
CWE Content Team MITRE 2011-09-13 +00:00 updated Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2012-05-11 +00:00 updated Common_Consequences, Demonstrative_Examples, References, Relationships
CWE Content Team MITRE 2014-07-30 +00:00 updated Relationships, Taxonomy_Mappings
CWE Content Team MITRE 2017-01-19 +00:00 updated Relationships
CWE Content Team MITRE 2017-11-08 +00:00 updated Causal_Nature, Taxonomy_Mappings
CWE Content Team MITRE 2020-02-24 +00:00 updated Relationships
CWE Content Team MITRE 2021-03-15 +00:00 updated Potential_Mitigations, References
CWE Content Team MITRE 2023-04-27 +00:00 updated Relationships
CWE Content Team MITRE 2023-06-29 +00:00 updated Mapping_Notes
CWE Content Team MITRE 2025-12-11 +00:00 updated Detection_Factors
CWE Content Team MITRE 2026-10-28 +00:00 updated References, Relationships, Taxonomy_Mappings