CVE DatabaseCVE-2023-38831
한국어 권고문 →
CVE-2023-388317.8/HIGHCISA KEVCWE-345CWE-351

WinRAR Arbitrary Code Execution Vulnerability (CVE-2023-38831) Security Advisory

⚡ Jump to Patch
Affected Vendors
rarlab
Affected Components
winrar
Published Date
2023-08-23
CVSS v3.1
7.8
HIGH
EPSS (30d)
99.8%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

All Windows endpoint environments running RARLAB WinRAR versions prior to 6.23.

Impact

Attackers can execute arbitrary code in the background when a user attempts to open a seemingly benign file within a crafted ZIP archive, leading to full system compromise.

Mitigation

Immediately upgrade WinRAR to version 6.23 or higher, and restrict execution of untrusted archive files.

Affected Products & Version Scope

RARLAB WinRAR versions prior to 6.23 on Windows platforms

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch & Version Upgrade Commands

The primary remediation is upgrading WinRAR to version 6.23 or later. In enterprise environments, administrators can deploy the update silently using Windows Package Manager (Winget) or Group Policy Objects (GPO).

powershell
# Upgrade WinRAR silently using Windows Package Manager (Winget)
winget upgrade --id RARLab.WinRAR --silent

# Verify the installed WinRAR version via Registry
(Get-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\WinRAR archiver').DisplayVersion

2. Temporary Workaround & Hardening Configuration

If immediate patching is not feasible, configure security controls to block or monitor the execution of scripts from temporary directories, and block suspicious ZIP archives at the email gateway.

powershell
# Block execution of .cmd/.bat files from WinRAR temporary extraction directories via PowerShell
$RulePath = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Paths\{winrar-temp-block}'
New-Item -Path $RulePath -Force | Out-Null
New-ItemProperty -Path $RulePath -Name 'Path' -Value '%TEMP%\Rar$*\*.cmd' -PropertyType String -Force

3. Log Audit & IoC Verification Commands

Search for potential indicators of compromise (IoCs) by scanning the local AppData Temp directory for anomalous nested file structures generated during WinRAR execution.

powershell
# Scan WinRAR temporary extraction folders for suspicious double extensions or trailing spaces
Get-ChildItem -Path "$env:TEMP\Rar$*" -Recurse -ErrorAction SilentlyContinue | 
Where-Object { $_.Name -match '\.(pdf|jpg|png|txt)\s+\.(exe|cmd|bat|scr|pif)$' } | 
Select-Object FullName, Length, CreationTime
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
SentinelOne Singularity AI EDR
Immediately upgrade WinRAR to version 6.23 or higher and avoid opening untrusted ZIP archives from external sources.

Block Kernel Privilege Escalation & Ransomware Payloads Before You Can Reboot

Protect unpatched Windows, Linux, and macOS workloads against in-memory exploitation and lateral movement with autonomous EDR.

100% MITRE ATT&CK Detection · 1-Click Rollback

Technical Root Cause & Exploitation Mechanics

1. Vulnerability Overview & Root Cause

This vulnerability (CVE-2023-38831) is a logical flaw in the file expansion and path validation logic of RARLAB WinRAR. When WinRAR processes a ZIP archive, it fails to properly isolate file execution from directory structures with matching names (CWE-345, CWE-351). If an archive contains a benign file alongside a directory sharing the exact same base name, WinRAR inadvertently extracts and processes the contents of that directory during the execution attempt of the benign file.

2. Exploitation Mechanics & Attack Scenario

An attacker crafts a malicious ZIP archive containing a benign file (e.g., 'document.pdf') and a folder named identically with a trailing space (e.g., 'document.pdf '). Inside this folder, the attacker places a malicious executable or script (e.g., 'document.pdf .cmd'). When the victim double-clicks 'document.pdf' within the WinRAR GUI, WinRAR's internal extraction routine extracts both the file and the matching folder to a temporary directory. Due to parameter expansion and ShellExecute behavior on Windows, the operating system executes the malicious script from the folder instead of opening the intended PDF file.

3. Infrastructure & Business Impact

This vulnerability was actively exploited in the wild as a zero-day from April through October 2023, targeting financial trading accounts and government entities. Successful exploitation allows remote threat actors to gain initial access, execute arbitrary payloads, and establish persistence on corporate endpoints, posing severe risks of data exfiltration, ransomware deployment, and lateral movement within the internal network.

Official Vendor Advisories & References

Frequently Asked SecOps Questions (CVE-2023-38831)

FAQ

Q1. How critical is CVE-2023-38831 and is it actively exploited in the wild?

CVE-2023-38831 is rated CVSS 7.8 (HIGH) with a 30-day EPSS exploitation probability of 99.8%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.

Q2. Which vendors and products are affected by CVE-2023-38831?

Primary impacted vendors include rarlab across winrar. Scope summary: RARLAB WinRAR versions prior to 6.23 on Windows platforms

Q3. What temporary mitigations or workarounds exist for CVE-2023-38831 before patching?

[Mitigation] Immediately upgrade WinRAR to version 6.23 or higher, and restrict execution of untrusted archive files. Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.

SECOPS WORKBENCH INTEGRATION

Generate an Internal Engineering Notice or CISO Report for CVE-2023-38831

Instantly format this advisory into an executive CISO summary or engineering patch ticket.

Generate Report →

🔗 Related Advisories in Similar Stack (rarlab)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO