Exploit database

Vulnerability

CVE-2024-2961

Vulnerability details

Score
7.3
Severity
high

CVSS 3.1 · CISA-ADP

Vector string

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

Description

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.

CVE Program

Exploit source choices

16 sources
CosmicSting: Magento Arbitrary File Read (CVE-2024-34102) + PHP Buffer Overflow in the iconv() function of glibc (CVE-2024-2961)
MSF-linux--http--magento_xxe_to_glibc_buf_overflowMetasploitLinux,Unix / remotePreferred

This combination of an Arbitrary File Read (CVE-2024-34102) and a Buffer Overflow in glibc (CVE-2024-2961) allows for unauthenticated Remote Code Execution on the following versions of Magento and Adobe Commerce and earlier if the PHP and glibc versions are also vulnerable: - 2.4.7 and earlier - 2.4.6-p5 and earlier - 2.4.5-p7 and earlier - 2.4.4-p8 and earlier Vulnerable PHP versions: - From PHP 7.0.0 (2015) to 8.3.7 (2024) Vulnerable iconv() function in the GNU C Library: - 2.39 and earlier The exploit chain is quite interesting and for more detailed information check out the references. The tl;dr being: CVE-2024-34102 is an XML External Entity vulnerability leveraging PHP filters to read arbitrary files from the target system. The exploit chain uses this to read /proc/self/maps, providing the address of PHP's heap and the libc's filename. The libc is then downloaded, and the offsets of libc_malloc, libc_system and libc_realloc are extracted, and made use of later in the chain. With this information and expert knowledge of PHP's heap (chunks, free lists, buckets, bucket brigades), CVE-2024-2961 can be exploited. A long chain of PHP filters is constructed and sent in the same way the XXE is exploited, building a payload in memory and using the buffer overflow to execute it, resulting in an unauthenticated RCE.

2024-07-26magento_xxe_to_glibc_buf_overflow.rb
bollwarm/sectoolset
GH-c54d5162b2ca71cdeb00c2f8278f306eGitHubUnofficial GitHub source

The security tool(project) Set from github。github安全项目工具集合

2017-02-0822 files · 1,458 stars
ambionics/cnext-exploits
GH-fced1d4028e52fffc8d13e0a8f61ac53GitHubUnofficial GitHub source

Exploits for CNEXT (CVE-2024-2961), a buffer overflow in the glibc's iconv()

2024-05-2710 files · 505 stars
aneasystone/github-trending
GH-57cc0777a8d8d3714cc5a0fca8b6fd16GitHubUnofficial GitHub source

使用 Github Actions 跟踪 Github 趋势项目。

2022-08-0955 files · 213 stars
bttea/bttealfi
GH-d8602273b2dbeb2af07901f5b3e28c6eGitHubUnofficial GitHub source

An LFI vulnerability scanning tool

2022-12-17101 files · 19 stars
kyotozx/cve-2024-2961-remote-file-read
GH-6aa485008a94f0c9c9f97926bfaf803eGitHubUnofficial GitHub source

This script demonstrates a proof-of-concept (PoC) for exploiting a file read vulnerability in the iconv library, as detailed in Ambionics Security's blog https://www.ambionics.io/blog/iconv-cve-2024-2961-p1.

2025-01-272 files · 5 stars
rvzsec/cve-2024-2961
GH-8528d76519da7f525517d5d993c3aa4dGitHubUnofficial GitHub source

CVE-2024–2961 Security Issue Mitigation Script

2024-05-202 files · 5 stars
suce0155/cve-2024-2961
GH-00157e13e7aa8aba695d18f34bc225bfGitHubUnofficial GitHub source

CVE-2024-2961 Cnext RCE Exploit with Buddyforms 2.7.7

2025-02-044 files · 4 stars
kjdfklha/cve-2024-2961_poc
GH-c39c33b5111c2c9c2daf7889c3679cd4GitHubUnofficial GitHub source

kjdfklha/cve-2024-2961_poc source repository

2024-06-042 files · 2 stars
omarelshopky/exploit_cve-2023-26326_using_cve-2024-2961
GH-5e45705f84a4c71d3d63f4b2eac1ca85GitHubUnofficial GitHub source

Exploit for CVE-2023-26326 in the WordPress BuddyForms plugin, leveraging CVE-2024-2961 for remote code execution. This exploit bypasses PHP 8+ deserialization limitations by chaining vulnerabilities with php://filter.

2025-02-028 files · 1 stars
wubinworks/magento2-cosmic-sting-patch
GH-97e08b80a059bbe817ea1764e529b3b1GitHubUnofficial GitHub source

An alternative solution(as a Magento 2 extension) to fix the XXE vulnerability CVE-2024-34102(aka Cosmic Sting). If you cannot upgrade Magento or cannot apply the official patch, try this one.

2024-08-0810 files · 1 stars
4wayhandshake/cve-2024-2961
GH-2d0a6c0dd196c89ee914a13d3fb55e6cGitHubUnofficial GitHub source

Uses CVE-2024-2961 to perform an arbitrary file read

2025-01-292 files · 0 stars
absolutedesignltd/iconvfix
GH-1620275291ed2ca145ff37d6a24d3d81GitHubUnofficial GitHub source

Bash script to patch for CVE-2024-2961

2024-05-302 files · 0 stars
clarissss/osticketfilereadintorce
GH-b46a84d18f0b73e2561db5df2a0c1a02GitHubUnofficial GitHub source

Full-chain exploit combining PHP filter chain injection with CVE-2024-2961 (CNEXT) for unauthenticated Remote Code Execution on vulnerable osTicket installations.

2026-03-034 files · 0 stars