CVE-2023-40481

7.8 HIGH

📋 TL;DR

This vulnerability in 7-Zip allows remote attackers to execute arbitrary code by tricking users into opening malicious SquashFS (SQFS) archive files. The flaw is an out-of-bounds write during SQFS file parsing that can lead to remote code execution in the context of the current process. All users of affected 7-Zip versions are vulnerable when processing untrusted SQFS files.

💻 Affected Systems

Products:
  • 7-Zip
Versions: Versions prior to 23.01
Operating Systems: Windows, Linux, macOS
Default Config Vulnerable: ⚠️ Yes
Notes: All default installations of 7-Zip that support SQFS file format parsing are vulnerable. The vulnerability affects both GUI and command-line versions.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise via remote code execution with the privileges of the user running 7-Zip, potentially leading to data theft, ransomware deployment, or persistent backdoor installation.

🟠

Likely Case

Malicious actors distribute weaponized SQFS files via phishing emails or malicious websites, leading to limited compromise of individual workstations when users open these files.

🟢

If Mitigated

With proper security controls, exploitation attempts are blocked by endpoint protection, and impact is limited to isolated systems with minimal privileges.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires user interaction (opening malicious file) but weaponization is likely given the RCE nature and ZDI disclosure. No public exploit code is currently available.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 23.01 and later

Vendor Advisory: https://sourceforge.net/p/sevenzip/discussion/45797/thread/713c8a8269/

Restart Required: No

Instructions:

1. Download latest 7-Zip version from official website. 2. Run installer and follow prompts. 3. No system restart required, but close all 7-Zip instances during installation.

🔧 Temporary Workarounds

Disable SQFS file association

windows

Remove SQFS file type association with 7-Zip to prevent automatic opening

Windows: Control Panel > Default Programs > Associate a file type or protocol with a program > Remove .sqfs association with 7-Zip

Block SQFS files at perimeter

all

Configure email/web gateways to block SQFS file attachments

🧯 If You Can't Patch

  • Implement application whitelisting to block execution of 7-Zip
  • Deploy endpoint protection with behavioral analysis to detect exploitation attempts

🔍 How to Verify

Check if Vulnerable:

Check 7-Zip version: Open 7-Zip > Help > About. If version is below 23.01, system is vulnerable.

Check Version:

Windows: "C:\Program Files\7-Zip\7z.exe" --version | findstr "Version"

Verify Fix Applied:

Verify 7-Zip version is 23.01 or higher using Help > About menu.

📡 Detection & Monitoring

Log Indicators:

  • Process creation events for 7z.exe with suspicious parent processes
  • File access events for .sqfs files followed by unexpected process launches

Network Indicators:

  • Downloads of SQFS files from untrusted sources
  • Unusual outbound connections after SQFS file processing

SIEM Query:

Process Creation where Image contains "7z.exe" AND CommandLine contains ".sqfs"

🔗 References

📤 Share & Export