# CVE-2023-38831: RARLAB WinRAR Code Execution

> Attackers can execute arbitrary code by tricking users into viewing a benign file in a specially crafted ZIP archive where a folder shares the file's name.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Yes, since 24 Aug 2023 (CISA KEV), used in ransomware
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** No
- **Published:** 23 Aug 2023
- **Updated:** 5 Aug 2026
- **Also known as:** CVE-2023-39583, CVE-2023-40270, GHSA-w5x7-vwr2-4x27

## What is CVE-2023-38831?

CVE-2023-38831 is a high-severity code injection vulnerability in n/a, published on 23 Aug 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

RARLAB WinRAR before 6.23 allows attackers to execute arbitrary code when a user attempts to view a benign file within a ZIP archive. The issue occurs because a ZIP archive may include a benign file (such as an ordinary .JPG file) and also a folder that has the same name as the benign file, and the contents of the folder (which may include executable content) are processed during an attempt to access only the benign file. This was exploited in the wild in April through October 2023.

Weakness: CWE-345 (Insufficient Verification of Data Authenticity), CWE-351 (Insufficient Type Distinction)

## Which versions are affected by CVE-2023-38831?

It affects 1 product.


Products: Rarlab Winrar.

## How do I fix CVE-2023-38831?

No fix has been published for CVE-2023-38831 yet. Limit exposure of the affected software until one is available. US federal agencies must fix it by 14 Sep 2023.

## Is CVE-2023-38831 being exploited?

Yes. Attackers have exploited CVE-2023-38831 in the wild since at least 24 Aug 2023, including in ransomware campaigns.

Public exploit code:

- CVE-2023-38831 winrar exploit generator (github_poc): https://github.com/b1tg/CVE-2023-38831-winrar-exploit
- 一款用于生成winrar程序RCE（即cve-2023-38831）的POC的工具。 (github_poc): https://github.com/Garck3h/cve-2023-38831
- An easy to install and easy to run tool for generating exploit payloads for CVE-2023-38831, WinRAR RCE before versions 6.23 (github_poc): https://github.com/ignis-sec/CVE-2023-38831-RaRCE
- lazy way to create CVE-2023-38831 winrar file for testing (github_poc): https://github.com/BoredHackerBlog/winrar_CVE-2023-38831_lazy_poc
- CVE-2023-38831 PoC (Proof Of Concept) (github_poc): https://github.com/HDCE-inc/CVE-2023-38831
- Understanding WinRAR Code Execution Vulnerability (CVE-2023-38831)  (github_poc): https://github.com/knight0x07/WinRAR-Code-Execution-Vulnerability-CVE-2023-38831

## Other vulnerabilities in n/a

- [CVE-2025-6218](https://insights.sbomify.com/CVE-2025-6218/): RARLAB WinRAR Path Traversal (high 7.8, exploited in the wild)
- [CVE-2018-20250](https://insights.sbomify.com/CVE-2018-20250/): WinRAR Absolute Path Traversal (high 7.8, exploited in the wild)
- [CVE-2008-7144](https://insights.sbomify.com/CVE-2008-7144/): Memory corruption in n/a (critical 10.0)
- [CVE-2004-1254](https://insights.sbomify.com/CVE-2004-1254/): Integer overflow in n/a (critical 10.0)
- [CVE-2006-3845](https://insights.sbomify.com/CVE-2006-3845/): Memory corruption in n/a (critical 9.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-38831 and fix it if it is affected.

What it is: CVE-2023-38831 is a high-severity code injection vulnerability in n/a, published on 23 Aug 2023. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: Yes. Attackers have exploited CVE-2023-38831 in the wild since at least 24 Aug 2023, including in ransomware campaigns.

Affected product: n/a. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-38831/ (Markdown: https://insights.sbomify.com/CVE-2023-38831/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-38831
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-38831
- OSV: https://osv.dev/vulnerability/CVE-2023-38831

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-38831/
Summaries are generated and may contain mistakes; the official description above is the record.
