Miggo Logo

CVE-2021-4214: A heap overflow flaw was found in libpngs' pngimage.c program. This flaw allows an attacker with...

5.5

CVSS Score
3.1

Basic Information

EPSS Score
0.12243%
Published
8/25/2022
Updated
2/2/2023
KEV Status
No
Technology
-

Technical Details

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

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The analysis is primarily based on the information provided in GitHub issue #302, which is referenced by the CVE. The issue includes an ASAN (AddressSanitizer) trace that clearly identifies the function 'compare_read' in 'contrib/libtests/pngimage.c' as the location of the heap buffer overflow. The trace also shows the call stack leading to this function: 'main' -> 'do_test' -> 'test_one_file' -> 'compare_read'. The issue description further explains that the overflow occurs because the buffers 'orig' and 'row' might not have sufficient data for the specified bytes-per-pixel ('bpp'), leading to an out-of-bounds access. The CVE description also specifies that the flaw is in 'libpngs' pngimage.c program' (referring to the utility). The provided commit information (301f7a14295a3bdfaf406dbb5004d0784dc137ea) is related to a fuzzer update and not a direct fix for this vulnerability; the issue report indicates the vulnerability was present in the code at the time of that commit. Since no fixing patch was provided, the identification of vulnerable functions relies on the diagnostic information from the issue tracker.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

* ***p ov*r*low *l*w w*s *oun* in li*pn*s' pn*im***.* pro*r*m. T*is *l*w *llows *n *tt**k*r wit* lo**l n*twork ****ss to p*ss * sp**i*lly *r**t** PN* *il* to t** pn*im*** utility, **usin* *n *ppli**tion to *r*s*, l***in* to * **ni*l o* s*rvi**.

Reasoning

T** *n*lysis is prim*rily **s** on t** in*orm*tion provi*** in *it*u* issu* #***, w*i** is r***r*n*** *y t** *V*. T** issu* in*lu**s *n *S*N (***r*ssS*nitiz*r) tr*** t**t *l**rly i**nti*i*s t** *un*tion '*omp*r*_r***' in '*ontri*/li*t*sts/pn*im***.*'