Miggo Logo

CVE-2021-20311: A flaw was found in ImageMagick in versions before 7.0.11, where a division by zero in...

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.2686%
Published
5/24/2022
Updated
1/29/2023
KEV Status
No
Technology
-

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability description explicitly mentions sRGBTransformImage in MagickCore/colorspace.c as the location of the division by zero. The provided commit 70aa86f5d5d8aa605a918ed51f7574f433a18482 shows changes in this function where direct division by film_gamma is replaced by multiplication with the result of PerceptibleReciprocal(film_gamma). This is a standard way to handle potential division by zero. The same pattern of change was observed in the TransformsRGBImage function within the same file, indicating it was likely susceptible to the same vulnerability or was fixed as a preventative measure. The commit message also mentions "possible divide by zero". The other modified files in the commit relate to buffer clearing and thumbnail parsing, which are not directly related to the described division by zero in colorspace.c.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

* *l*w w*s *oun* in Im***M**i*k in v*rsions ***or* *.*.**, w**r* * *ivision *y z*ro in sR**Tr*ns*ormIm***() in t** M**i*k*or*/*olorsp***.* m*y tri***r un***in** ****vior vi* * *r**t** im*** *il* t**t is su*mitt** *y *n *tt**k*r pro**ss** *y *n *ppli*

Reasoning

T** vuln*r**ility **s*ription *xpli*itly m*ntions `sR**Tr*ns*ormIm***` in `M**i*k*or*/*olorsp***.*` *s t** lo**tion o* t** *ivision *y z*ro. T** provi*** *ommit `****************************************` s*ows ***n**s in t*is *un*tion w**r* *ir**t *i