Stopping Active Exploits Impact, Detection,

Secably Research
Jul 23, 2026
6 min read
Vulnerability Research
Actively Cve Explo Unpacking Vulnerability

Unpacking the Actively Exploited WinRAR Vulnerability (CVE-2023-38831)

WinRAR, a widely used file archiving utility with over 500 million users, was recently at the center of a critical arbitrary code execution vulnerability, CVE-2023-38831. This flaw allowed attackers to execute malicious code when a user merely attempted to view a benign file within a specially crafted ZIP archive. Threat actors actively exploited this zero-day vulnerability in the wild for several months before its public disclosure and patch.

What the Vulnerability Is and Its Impact

CVE-2023-38831 is a high-severity arbitrary code execution vulnerability in RARLAB WinRAR versions prior to 6.23. The National Institute of Standards and Technology (NIST) assigned it a CVSS v3 score of 7.8 (High). Attackers could leverage this flaw to compromise system integrity and data confidentiality by executing arbitrary code.

The vulnerability's impact stems from WinRAR's widespread adoption across various operating systems, including Windows, Linux, and macOS. Exploitation occurred in the wild from at least April 2023, targeting sectors such as finance, energy, government, and cryptocurrency. Government-backed hacking groups and cybercrime organizations utilized this vulnerability to deliver various malware families, including DarkMe, GuLoader, Remcos RAT, Agent Tesla, BumbleBee, WhiteSnake stealer, njRAT trojan, and BOXRAT backdoor.

Technical Root Cause Analysis

The core of CVE-2023-38831 lies in a logical flaw within WinRAR's handling of ZIP archive contents. Specifically, the vulnerability arises when a ZIP archive contains both a seemingly benign file (e.g., a .JPG, .PNG, or .PDF) and a folder that shares the exact same name as that benign file.

When a user attempts to view the benign file within such a maliciously crafted archive, WinRAR's extraction logic becomes confused. Instead of only processing the intended benign file, WinRAR extracts both the selected file and the contents of the identically named folder into a temporary directory. This erroneous processing results in the malicious content from the folder being placed in the same temporary location.

A critical component of the root cause is how WinRAR interacts with Windows' ShellExecuteExW function. After extraction, WinRAR calls ShellExecuteExW to open the user-selected file. However, the function receives a non-normalized path as input, often containing a trailing space in the filename (e.g., "poc.png_" where underscore denotes a space). Windows' ShellExecute then attempts to identify file extensions. If it encounters an extension with spaces, ShellExecute's internal PathFindExtension fails. Instead of stopping, ShellExecute proceeds to call ApplyDefaultExts, which iterates through files in the directory and executes the first file matching common executable extensions like .pif, .com, .exe, .bat, .lnk, or .cmd. This leads to the execution of the malicious file (e.g., "poc.png_.cmd") that was placed in the temporary directory, instead of the benign file.

Exploitation Mechanics

Exploiting CVE-2023-38831 involves crafting a specific ZIP archive structure. An attacker creates an archive that contains a decoy file, such as image.jpg, and a directory named image.jpg (with a trailing space). Inside this directory, the attacker places a malicious executable or script, for example, image.jpg .cmd.

When a victim opens the crafted archive using a vulnerable WinRAR version and attempts to "view" or "open" the seemingly harmless image.jpg, WinRAR extracts both the legitimate image.jpg and the contents of the image.jpg directory to a temporary location. Due to the path normalization quirk and ShellExecute's behavior, the system then executes the malicious image.jpg .cmd file. This execution occurs without explicit user consent for the malicious file, as the user believed they were opening an image.

Attackers frequently deliver these malicious archives via spear-phishing campaigns. The lure often involves financial themes, given the targeting of financial traders. Once executed, the malicious script can download additional payloads, establish persistence, or exfiltrate data.

Detection: How to Check If You're Affected

Organizations must verify their WinRAR installations. The primary indicator of being affected by CVE-2023-38831 is running WinRAR versions prior to 6.23. Users can check their WinRAR version by navigating to "Help" and "About WinRAR" within the application.

Endpoint detection and response (EDR) solutions should monitor for suspicious process creation. Specifically, look for unexpected executable files extracted from ZIP archives or processes initiated immediately after viewing ZIP contents. Unusual file names in temporary directories, especially those mimicking legitimate file names but with suspicious extensions (e.g., .cmd, .bat, .exe), are strong indicators of compromise.

Network traffic analysis can help detect post-exploitation activity. Monitor for unusual outbound connections from user workstations following archive interactions, which may indicate malware command-and-control (C2) communication or data exfiltration. Tools like Zondex can assist in identifying exposed services or unusual network patterns. For organizations seeking continuous visibility into their attack surface, Secably offers attack surface management capabilities that could identify unpatched systems or anomalous network behavior. Additionally, a free website vulnerability scanner can help identify client-side issues that might lead to such downloads, while a CMS vulnerability scanner checks for known flaws in web applications that could host malicious archives.

Python-based scanning tools exist to detect this specific vulnerability. For example, a GitHub project named yezzfusl/cve_2023_38831_scanner aims to detect CVE-2023-38831 by incorporating file integrity checks, process memory scanning, and network traffic analysis. This Python application operates by orchestrating a scanner module, integrity checker, memory scanner, and network analyzer, and can be integrated with a sandbox environment for safe execution and analysis.


# Example (conceptual) command for a WinRAR version check
# This is a general approach; actual WinRAR command line options vary.
# Typically, version check is done via GUI or registry.
# For programmatic checks, one might query the registry or check file properties.

# Example of checking WinRAR version from a command line (conceptual, may vary by system/install)
# Get the version from the WinRAR executable properties or registry
# This would require parsing output or registry queries specific to WinRAR's installation
# For instance, a PowerShell command might look like:
# (Get-Item "C:\Program Files\WinRAR\WinRAR.exe").VersionInfo.FileVersion

# Manual check:
# 1. Open WinRAR
# 2. Go to Help -> About WinRAR
# 3. Note the version number. Ensure it is 6.23 or higher.

Remediation Steps

The most crucial remediation step is to immediately update all WinRAR installations to version 6.23 or later. RARLAB released this version specifically to address CVE-2023-38831.

Beyond patching, implement robust security awareness training for all users. Educate employees about the dangers of opening suspicious email attachments and files from untrusted sources, even if they appear benign. Emphasize caution when dealing with archive files, especially those received unexpectedly.

Deploy comprehensive endpoint security monitoring to detect anomalous execution flows originating from ZIP operations. Configure email security technologies like SPF, DKIM, and DMARC to authenticate incoming emails and reduce the likelihood of phishing attacks delivering malicious archives. Implement application control policies to restrict the execution of applications from temporary directories or compressed archives. For ongoing monitoring and vulnerability management, Secably offers paid monitoring plans starting at $19/month, alongside free instant tools. This can provide continuous oversight of your digital assets and alert you to potential vulnerabilities.

Timeline of Disclosure

  • April 2023: Active exploitation of the zero-day vulnerability begins in the wild by cybercrime groups.
  • July 10, 2023: Group-IB Threat Intelligence unit discovers the previously unknown vulnerability while researching the DarkMe malware.
  • July 12, 2023: Group-IB researchers attempt to request a CVE number from MITRE Corporation.
  • July 20, 2023: RARLAB releases a beta version of the patch.
  • August 2, 2023: RARLAB releases WinRAR version 6.23, which contains the official fix for the vulnerability.
  • August 15, 2023: MITRE Corporation officially assigns the vulnerability as CVE-2023-38831.
  • August 23, 2023: NIST officially discloses CVE-2023-38831. Group-IB publishes a detailed blog post.
  • August 2023 - October 2023: Active exploitation by various threat actors, including government-backed groups, continues.

Check your site for vulnerabilities

Run a free security scan — no signup, results in seconds.

Related Posts

Stronger security starts with visibility.

Scan your website for vulnerabilities and get actionable insights.