In the function ReadTXTImage() in coders/txt.c in ImageMagick 7.0.6-10, an integer overflow might occur for the addition operation "GetQuantumRange(depth)+1" when "depth" is large, producing a smaller value than expected. As a result, an infinite loop would occur for a crafted TXT file that claims a very large "max_value" value.
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.
Link | Tags |
---|---|
https://usn.ubuntu.com/3681-1/ | third party advisory vendor advisory |
https://security.gentoo.org/glsa/201711-07 | third party advisory vendor advisory |
https://github.com/ImageMagick/ImageMagick/issues/713 | issue tracking patch exploit third party advisory |
https://lists.debian.org/debian-lts-announce/2019/05/msg00015.html | third party advisory mailing list |
https://lists.debian.org/debian-lts-announce/2020/09/msg00007.html | third party advisory mailing list |
https://github.com/ImageMagick/ImageMagick/commit/50f54462076648ac2e36c3f58f4dadd4babbf1c9 | patch vendor advisory |