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
CVE ID
GHSA ID
EPSS Score
0.99689%
CWE
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 AI
Root 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.
- The
iconv()
function itself is identified as a vulnerable function because it's the API entry point. The provided commitf9dc609e06b1136bb0408be9605ce7973a767ada
includes a new test case (iconvdata/tst-iconv-iso-2022-cn-ext.c
) that explicitly callsiconv()
to trigger and verify the fix for the vulnerable path. - 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 namedgconv
) was missing bounds checks. The patch in commitf9dc609e06b1136bb0408be9605ce7973a767ada
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. Bothiconv()
(as the user-facing API) and the internalgconv
function (withiniconvdata/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.