Miggo Logo

CVE-2024-2961:
The iconv() function in the GNU C Library versions 2.39 and older may overflow the output buffer...

7.3

CVSS Score
3.1

Basic Information

EPSS Score
0.99689%
Published
4/17/2024
Updated
2/13/2025
KEV Status
No
Technology
-

Technical Details

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

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability CVE-2024-2961 describes a buffer overflow in the iconv() function of the GNU C Library when converting strings to the ISO-2022-CN-EXT character set.

  1. The iconv() function itself is identified as a vulnerable function because it's the API entry point. The provided commit f9dc609e06b1136bb0408be9605ce7973a767ada includes a new test case (iconvdata/tst-iconv-iso-2022-cn-ext.c) that explicitly calls iconv() to trigger and verify the fix for the vulnerable path.
  2. The core of the vulnerability lies within the internal conversion logic for the ISO-2022-CN-EXT character set, which is implemented in iconvdata/iso-2022-cn-ext.c. The function responsible for the conversion within this file (typically named gconv) was missing bounds checks. The patch in commit f9dc609e06b1136bb0408be9605ce7973a767ada directly modifies this file by adding checks (if (outptr + 4 > outend)) before writing 4-byte escape sequences for SS2designation (e.g., ESC $*H) and SS3designation (e.g., ESC $+I). The commit message confirms these specific escape sequences were problematic due to missing checks. Both iconv() (as the user-facing API) and the internal gconv function (within iconvdata/iso-2022-cn-ext.c, where the defective logic resided) are critical to understanding the vulnerability and would appear in a runtime profile during exploitation or when triggering the bug.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

T** i*onv() *un*tion in t** *NU * Li*r*ry v*rsions *.** *n* ol**r m*y ov*r*low t** output *u***r p*ss** to it *y up to * *yt*s w**n *onv*rtin* strin*s to t** ISO-****-*N-*XT ***r**t*r s*t, w*i** m*y ** us** to *r*s* *n *ppli**tion or ov*rwrit* * n*i*

Reasoning

T** vuln*r**ility *V*-****-**** **s*ri**s * *u***r ov*r*low in t** `i*onv()` *un*tion o* t** *NU * Li*r*ry w**n *onv*rtin* strin*s to t** ISO-****-*N-*XT ***r**t*r s*t. *. T** `i*onv()` *un*tion its*l* is i**nti*i** *s * vuln*r**l* *un*tion ****us*