CVE-2023-52168
High · 8.4CVSS
8.4
EPSS
0.3%
Published
Jul 3, 2024
CISA due date
—
Cloudanix analysis
A popular file compression program can be tricked into letting attackers take control of a computer when it opens a specially crafted archive file.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap-based buffer overflow in the NTFS handler allows an attacker to overwrite two bytes at multiple offsets beyond the allocated buffer (buffer+512*i-2 for i>=9), potentially corrupting adjacent heap structures and enabling arbitrary code execution or denial of service during archive extraction.
Why it matters to the business
Organizations relying on 7-Zip for file decompression face risk of system compromise or service disruption when processing untrusted archives, with elevated urgency for high-volume extraction workflows or automated pipelines that handle external files.
How an attack unfolds
An attacker crafts a specially malformed NTFS-structured archive that triggers the overflow in NtfsHandler.cpp when opened or extracted by a vulnerable 7-Zip version; the limited two-byte overwrites at predictable offsets can be chained to corrupt heap metadata and achieve code execution without user interaction beyond opening the file.
How to fix it
Upgrade 7-Zip to version 24.01 or later on all systems; replace any embedded or bundled instances of the vulnerable 7zz binary; disable automatic extraction of untrusted archives until patched.
How to confirm the fix worked
Verify installed 7-Zip version is 24.01 or higher; test extraction of known-malformed NTFS test archives in a sandbox to confirm absence of overflow behavior; review package managers and build pipelines for pinned older versions.
Typical attack path
- Create a malicious archive exploiting the NTFS handler overflow
- Deliver the archive via email, download, or shared storage
- Victim or automated process opens or extracts the archive with 7-Zip
- Overflow corrupts heap memory leading to code execution or crash
How to detect it
Monitor process creation and file access logs for 7-Zip binaries handling archives from untrusted sources; inspect crash dumps or heap corruption indicators in 7zz or 7z processes; correlate with file creation timestamps of suspicious archives.
What your security team should do
- Prioritize immediate upgrade to 7-Zip 24.01 across endpoints and servers
- Inventory all instances of 7-Zip including command-line 7zz binaries
- Block or sandbox processing of untrusted archives until remediation complete
- Update detection rules to flag older 7-Zip versions in software inventory
The record
The NtfsHandler.cpp NTFS handler in 7-Zip before 24.01 (for 7zz) contains a heap-based buffer overflow that allows an attacker to overwrite two bytes at multiple offsets beyond the allocated buffer size: buffer+512*i-2, for i=9, i=10, i=11, etc.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | p7zip | 0 | No fix |
| Debian:12 | 7zip | 0 | No fix |
| Debian:12 | p7zip | 0 | No fix |
| Debian:13 | 7zip | 0 | 24.05+dfsg-1 |
| Debian:13 | p7zip | 0 | 16.02+transitional.1 |
| Debian:14 | 7zip | 0 | 24.05+dfsg-1 |
| SUSE:Enterprise Storage 7.1 | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP5 | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP6 | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise Server 12 SP5 | p7zip | 0 | 9.20.1-7.6.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise Server 15 SP3-LTSS | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | p7zip | 0 | 9.20.1-7.6.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Manager Proxy 4.3 | p7zip | 0 | 16.02-150200.14.12.1 |
| SUSE:Manager Server 4.3 | p7zip | 0 | 16.02-150200.14.12.1 |
| Ubuntu:22.04:LTS | 7zip | 0 | No fix |
| Ubuntu:24.04:LTS | 7zip | 0 | No fix |
| Ubuntu:24.10 | 7zip | 0 | No fix |
| Ubuntu:Pro:22.04:LTS | 7zip | 0 | 21.07+dfsg-4ubuntu0.1~esm1 |
| Ubuntu:Pro:24.04:LTS | 7zip | 0 | 23.01+dfsg-11ubuntu0.1~esm1 |
| openSUSE:Leap 15.5 | p7zip | 0 | 16.02-150200.14.12.1 |
| openSUSE:Leap 15.6 | p7zip | 0 | 16.02-150200.14.12.1 |
Related vulnerabilities
- CVE-2025-0411 7-Zip Mark-of-the-Web Bypass Vulnerability. Also affects p7zip
- CVE-2024-11612 7-Zip CopyCoder Infinite Loop Denial-of-Service Vulnerability. Also affects p7zip
- CVE-2023-52169 The NtfsHandler.cpp NTFS handler in 7-Zip before 24.01 (for 7zz) contains an… Also affects p7zip
- CVE-2016-2334 Heap-based buffer overflow in the NArchive::NHfs::CHandler::ExtractZlibFile method in… Also affects p7zip
- CVE-2016-2335 The CInArchive::ReadFileItem method in Archive/Udf/UdfIn.cpp in 7zip 9.20 and 15.05 beta… Also affects p7zip
- CVE-2023-40481 7-Zip SquashFS File Parsing Out-Of-Bounds Write Remote Code Execution Vulnerability. Also affects 7zip
- CVE-2023-31102 Ppmd7.c in 7-Zip before 23.00 allows an integer underflow and invalid read operation via… Also affects 7zip
- CVE-2024-11477 7-Zip Zstandard Decompression Integer Underflow Remote Code Execution Vulnerability. Also affects 7zip