Description
Sign extension error in the ReadDIBImage function in ImageMagick before 6.3.5-9 allows context-dependent attackers to execute arbitrary code via a crafted width value in an image file, which triggers an integer overflow and a heap-based buffer overflow.
Vulnerability type
CWE-681
Incorrect Conversion between Numeric Types
When converting from one data type to another, such as long to integer, data can be omitted or translated in a way that produces unexpected values. If the resulting values are used in a sensitive context, then dangerous behaviors may occur.
Impact on systems
| Scope | Impact |
| Other, Integrity |
Unexpected State, Quality Degradation The program could wind up using the wrong number and generate incorrect results. If the number is used to allocate resources or make a security decision, then this could introduce a vulnerability. |
How to prevent it
Implementation
Avoid making conversion between numeric types. Always check for the allowed ranges.
All 123 CWE-681 CVEs, with trend and prevention