# CVE-2024-10389: Path Traversal in Safearchive

> Attackers can write arbitrary files via symbolic links in archives on case-insensitive filesystems, potentially leading to code execution.

- **Severity:** Medium 5.9 (`CVSS:4.0/AV:L/AC:L/AT:P/PR:H/UI:P/VC:L/VI:H/VA:L/SC:L/SI:H/SA:L/AU:Y/R:U/V:D/RE:L/U:Green`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 4 Nov 2024
- **Updated:** 21 Nov 2024
- **Also known as:** GHSA-q3rp-vvm7-j8jg, GO-2024-3251

## What is CVE-2024-10389?

CVE-2024-10389 is a medium-severity path traversal vulnerability in Google Safearchive, published on 4 Nov 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

There exists a Path Traversal vulnerability in Safearchive on Platforms with Case-Insensitive Filesystems (e.g., NTFS). This allows Attackers to Write Arbitrary Files via Archive Extraction containing symbolic links. We recommend upgrading past commit f7ce9d7b6f9c6ecd72d0b0f16216b046e55e44dc

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory), CWE-427 (Uncontrolled Search Path Element)

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

3 open source packages ship an affected version, including github.com/google/safearchive. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/google/safearchive` | Go | All versions | 0.0.0-20241025131057-f7ce9d7b6f9c |
| `github.com/google/safearchive` | Go | All versions | 0.0.0-20241025131057-f7ce9d7b6f9c |
| `github.com/google/safearchive` | Go | All versions | 0.0.0-20241025131057-f7ce9d7b6f9c |

Products: Google Safearchive.

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

Upgrade github.com/google/safearchive to 0.0.0-20241025131057-f7ce9d7b6f9c or later.

## Is CVE-2024-10389 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2024-10389 is a medium-severity path traversal vulnerability in Google Safearchive, published on 4 Nov 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-2024-10389 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/google/safearchive (Go): affected all versions; fixed in 0.0.0-20241025131057-f7ce9d7b6f9c
- github.com/google/safearchive (Go): affected all versions; fixed in 0.0.0-20241025131057-f7ce9d7b6f9c
- github.com/google/safearchive (Go): affected all versions; fixed in 0.0.0-20241025131057-f7ce9d7b6f9c

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

## Sources

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

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