# CVE-2023-40477: RARLAB WinRAR Recovery Volume Improper Validation of Array Index Remote Code Execution Vulnerability

> Remote attackers can execute arbitrary code by tricking users into opening malicious files due to improper array index validation in WinRAR.

- **Severity:** High 7.8 (`CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 3 May 2024
- **Updated:** 4 Nov 2025
- **Also known as:** DEBIAN-CVE-2023-40477, DLA-3542-1, DLA-3543-1, DLA-3653-1, GHSA-58vr-f4x9-3h36, MGASA-2023-0258, SUSE-SU-2023:4297-1, SUSE-SU-2023:4415-1, UBUNTU-CVE-2023-40477, openSUSE-SU-2024:13394-1

## What is CVE-2023-40477?

CVE-2023-40477 is a high-severity memory corruption vulnerability in RARLAB WinRAR, published on 3 May 2024. 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 Recovery Volume Improper Validation of Array Index Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of RARLAB WinRAR. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.

The specific flaw exists within the processing of recovery volumes. The issue results from the lack of proper validation of user-supplied data, which can result in a memory access past the end of an allocated buffer. An attacker can leverage this vulnerability to execute code in the context of the current process. Was ZDI-CAN-21233.

Weakness: CWE-129 (Improper Validation of Array Index)

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

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `clamav` | SUSE:Enterprise Storage 7.1 | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise Module for Basesystem 15 SP4 | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise Module for Basesystem 15 SP5 | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise Server 12 SP5 | All versions | 0.103.11-3.30.1 |
| `clamav` | SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise Server 15 SP2-LTSS | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise Server 15 SP3-LTSS | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | All versions | 0.103.11-3.30.1 |
| `clamav` | SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Manager Proxy 4.2 | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | SUSE:Manager Server 4.2 | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | openSUSE:Leap 15.4 | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | openSUSE:Leap 15.5 | All versions | 0.103.11-150000.3.50.1 |
| `clamav` | openSUSE:Tumbleweed | All versions | 0.103.11-2.1 |

Products: Rarlab Winrar.

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

Apply the vendor's patch.

## Is CVE-2023-40477 being exploited?

There is no known exploitation of CVE-2023-40477 in the wild and no public exploit code.

Public exploit code:

- CVE-2023-40477 PoC by Wild-Pointer (github_poc): https://github.com/wildptr-io/Winrar-CVE-2023-40477-POC
- Scan for WinRAR files affected to CVE-2023-40477 (github_poc): https://github.com/winkler-winsen/Scan_WinRAR

## Other vulnerabilities in RARLAB WinRAR

- [CVE-2025-6218](https://insights.sbomify.com/CVE-2025-6218/): RARLAB WinRAR Path Traversal (high 7.8, exploited in the wild)
- [CVE-2023-38831](https://insights.sbomify.com/CVE-2023-38831/): RARLAB WinRAR Code Execution (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)

## Fix prompt for AI coding agents

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

What it is: CVE-2023-40477 is a high-severity memory corruption vulnerability in RARLAB WinRAR, published on 3 May 2024. 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: There is no known exploitation of CVE-2023-40477 in the wild and no public exploit code.

Affected product: RARLAB WinRAR. 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-40477/ (Markdown: https://insights.sbomify.com/CVE-2023-40477/index.md)
```

## Sources

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

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