CWE-190 - Integer Overflow or Wraparound

Description

The software 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 can introduce other weaknesses when the calculation is used for resource management or execution control. An integer overflow or wraparound 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 wrap to become a very small or negative number. While this may be intended behavior in circumstances that rely on wrapping, it can have security consequences if the wrap is unexpected. This is especially the case if the integer overflow can be triggered using user-supplied inputs. This becomes security-critical when the result is used to control looping, make a security decision, or determine the offset or size in behaviors such as memory allocation, copying, concatenation, etc. This weakness will generally lead to undefined behavior and therefore crashes. If the value in question is important to data (as opposed to flow), simple data corruption has occurred. If the wrap around results in other conditions such as buffer overflows, further memory corruption may occur. This weakness can sometimes trigger buffer overflows which can be used to execute arbitrary code. The weakness is introduced during Architecture and Design, Implementation stages.

Latest vulnerabilities for CWE-190

References

Description of CWE-190 on Mitre website