# CVE-2024-36116: Path traversal in Reposilite javadoc file expansion

> Attackers can exploit path traversal in Javadoc expansion to overwrite files and achieve remote code execution on Reposilite instances.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 19 Jun 2024
- **Updated:** 2 Aug 2024
- **Also known as:** GHSA-frvj-cfq4-3228

## What is CVE-2024-36116?

CVE-2024-36116 is a high-severity path traversal vulnerability in dzikoysk reposilite, published on 19 Jun 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Reposilite is an open source, lightweight and easy-to-use repository manager for Maven based artifacts in JVM ecosystem. Reposilite provides support for JavaDocs files, which are archives that contain documentation for artifacts. Specifically, JavadocEndpoints.kt controller allows to expand the javadoc archive into the server's file system and return its content. The problem is in the way how the archives are expanded, specifically how the new filename is created. The `file.name` taken from the archive can contain path traversal characters, such as '/../../../anything.txt', so the resulting extraction path can be outside the target directory. If the archive is taken from an untrusted source, such as Maven Central or JitPack for example, an attacker can craft a special archive to overwrite any local file on Reposilite instance. This could lead to remote code execution, for example by placing a new plugin into the '$workspace$/plugins' directory. Alternatively, an attacker can overwrite the content of any other package. Note that the attacker can use its own malicious package from Maven Central to overwrite any other package on Reposilite. Reposilite has addressed this issue in version 3.5.12. Users are advised to upgrade. There are no known workarounds for this vulnerability. This issue was discovered and reported by the GitHub Security lab and is also tracked as GHSL-2024-073.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2024-36116?

2 open source packages ship an affected version, including com.reposilite:reposilite-backend. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `com.reposilite:reposilite-backend` | Maven | From 3.3.0 | 3.5.12 |
| `com.reposilite:reposilite-backend` | Maven | From 3.3.0 | 3.5.12 |

Products: Reposilite Reposilite.

## How do I fix CVE-2024-36116?

Upgrade com.reposilite:reposilite-backend to 3.5.12 or later.

## Is CVE-2024-36116 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-36116 exists.

## Other vulnerabilities in dzikoysk reposilite

- [CVE-2024-36117](https://insights.sbomify.com/CVE-2024-36117/): Path traversal while serving Reposilite javadoc expanded files (high 8.6)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-36116 and fix it if it is affected.

What it is: CVE-2024-36116 is a high-severity path traversal vulnerability in dzikoysk reposilite, published on 19 Jun 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-36116 exists.

Affected packages and fixed versions:
- com.reposilite:reposilite-backend (Maven): affected from 3.3.0; fixed in 3.5.12
- com.reposilite:reposilite-backend (Maven): affected from 3.3.0; fixed in 3.5.12

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-2024-36116/ (Markdown: https://insights.sbomify.com/CVE-2024-36116/index.md)
```

## Sources

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

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