A wrap-around error happens when a variable exceeds the maximum value its data type can hold, causing it to unexpectedly reset to a very small, negative, or undefined number instead of increasing further.
This flaw, often called integer overflow or wraparound, is common in operations like counters, loops, or memory allocation where a value is repeatedly incremented. Developers might assume a number will simply stop increasing, but in languages like C or C++, it silently cycles back to the minimum, leading to crashes, incorrect calculations, or security vulnerabilities like buffer overflows. Detecting these errors manually is tricky because they depend on specific data types and runtime values. While SAST tools can flag risky code patterns, Plexicus uses AI to not only identify the risk but also suggest the precise code fix—such as using larger data types or boundary checks—automating remediation and saving hours of manual review across your application portfolio.
Impact: DoS: Crash, Exit, or RestartDoS: Resource Consumption (CPU)DoS: Resource Consumption (Memory)DoS: Instability
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.
Impact: Modify Memory
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.
Impact: Execute Unauthorized Code or CommandsBypass Protection Mechanism
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.
cMedium