cbcvebase.
CVE-2024-2961
published 2024-04-17

CVE-2024-2961: The iconv() function in the GNU C Library versions 2.39 and older may overflow the output buffer passed to it by up to 4 bytes when converting strings to the…

PriorityP180high7.3CVSS 3.1
AVLACLPRNUINSUCLILAH
ITWEXPLOITVulnCheck KEVInitial access
Exploited in the wild
EPSS
88.33%
99.8th percentile
The iconv() function in the GNU C Library versions 2.39 and older may overflow the output buffer passed to it by up to 4 bytes when converting strings to the ISO-2022-CN-EXT character set, which may be used to crash an application or overwrite a neighbouring variable.

Affected

12 ranges
VendorProductVersion rangeFixed in
debiandebian_linux
debianglibc< glibc 2.36-9+deb12u6 (bookworm)glibc 2.36-9+deb12u6 (bookworm)
eglibceglibc>= 0 < 2.19-0ubuntu6.15+esm32.19-0ubuntu6.15+esm3
gnuglibc>= 0 < 2.31-13+deb11u92.31-13+deb11u9
gnuglibc>= 0 < 2.36-9+deb12u62.36-9+deb12u6
gnuglibc>= 0 < 2.37-182.37-18
gnuglibc>= 0 < 2.37-182.37-18
gnuglibc>= 0 < 2.23-0ubuntu11.3+esm62.23-0ubuntu11.3+esm6
gnuglibc>= 0 < 2.27-3ubuntu1.6+esm22.27-3ubuntu1.6+esm2
gnuglibc>= 2.1.93 < 2.402.40
matrix-orgmatrix-sdk-crypto>= 0.7.0 < 0.7.10.7.1
the_gnu_c_libraryglibc>= 2.1.93 < 2.402.40

Detection & IOCsextracted from sources · hover to see the quote

pathphp://filter/read=convert.iconv.UTF-8/ISO-2022-CN-EXT/resource=/etc/passwd
path/proc/self/maps
path/usr/lib64/gconv/gconv-modules.d/gconv-modules-extra.conf
path/usr/lib64/gconv/gconv-modules
  • Detect exploitation attempts by monitoring HTTP requests containing the PHP filter chain targeting ISO-2022-CN-EXT character set conversion, which is the core trigger for the iconv buffer overflow.
  • In the CosmicSting exploit chain (CVE-2024-34102 + CVE-2024-2961), attackers read /proc/self/maps to leak heap and libc addresses; monitor for XXE/LFR requests targeting this path.
  • Monitor for injection of external scripts from lookalike domains (e.g. jgueurystatic[.]xyz, cdnstatics[.]net) into Magento/Adobe Commerce storefronts as indicators of post-exploitation skimmer deployment.
  • The exploit constructs a long chain of PHP filters sent via the XXE vector; detect anomalously long PHP filter chains in HTTP request parameters or bodies targeting Magento REST/GraphQL endpoints.
  • The overflow is triggered by SS2designation and SS3designation escape sequences during UCS4-to-ISO-2022-CN-EXT conversion; look for these byte sequences in iconv input streams.
  • Nuclei template uses a GET/POST fuzzing approach replacing query parameters with the PHP filter payload and matching 'root:x:0:0' in the response body to confirm LFR/RCE.
  • ·CVE-2024-2961 alone is a local buffer overflow; unauthenticated RCE requires chaining with an arbitrary file read vulnerability such as CVE-2024-34102 (CosmicSting XXE in Magento/Adobe Commerce).
  • ·Vulnerable PHP versions span a very wide range (7.0.0 through 8.3.7); do not assume modern PHP versions are safe without patching.
  • ·Disabling the ISO-2022-CN-EXT gconv module is an effective temporary mitigation but may break applications that rely on that character set conversion.
  • ·The overflow writes up to 4 bytes out-of-bounds; exploitation reliability depends on heap layout and libc offsets extracted at runtime from /proc/self/maps.

CVSS provenance

nvdv3.17.3HIGHCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H
osv9.8CRITICAL
vulncheck7.3HIGH
vendor_ubuntu9.8CRITICAL
vendor_oracle8.8HIGH
vendor_debian7.3HIGH
vendor_redhat7.3HIGH
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.