# CVE-2026-44788: SharpCompress: Directory traversal via directory entries in WriteToDirectory (zip slip variant)

> Attackers can exploit path traversal in SharpCompress to write arbitrary files outside the extraction directory, potentially leading to code execution.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 26 May 2026
- **Updated:** 27 May 2026
- **Also known as:** ECHO-f93c-a222-1d5f, GHSA-6c8g-7p36-r338

## What is CVE-2026-44788?

CVE-2026-44788 is a medium-severity path traversal vulnerability in adamhathcock sharpcompress, published on 26 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

SharpCompress is a fully managed C# library to deal with many compression types and formats. In 0.47.4 and earlier, a path traversal vulnerability in IArchive.WriteToDirectory() allows a malicious archive to create directories outside the intended extraction root. For TAR archives, this can be escalated to arbitrary file writes by chaining with a symlink entry, giving a full write primitive on the target filesystem subject to the permissions of the running process.

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

## Which versions are affected by CVE-2026-44788?

2 open source packages ship an affected version, including SharpCompress. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `SharpCompress` | NuGet | All versions | 0.48.0 |
| `SharpCompress` | NuGet | All versions | 0.48.0 |

Products: Adamhathcock Sharpcompress.

## How do I fix CVE-2026-44788?

Upgrade SharpCompress to 0.48.0 or later.

## Is CVE-2026-44788 being exploited?

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

Public exploit code:

- https://github.com/e-corp-demo/CVE-2026-44788 (github_poc): https://github.com/e-corp-demo/CVE-2026-44788

## Other vulnerabilities in adamhathcock sharpcompress

- [CVE-2018-1002206](https://insights.sbomify.com/CVE-2018-1002206/): Directory Traversal in SharpCompress (medium 5.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-44788 and fix it if it is affected.

What it is: CVE-2026-44788 is a medium-severity path traversal vulnerability in adamhathcock sharpcompress, published on 26 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-44788 exists.

Affected packages and fixed versions:
- SharpCompress (NuGet): affected all versions; fixed in 0.48.0
- SharpCompress (NuGet): affected all versions; fixed in 0.48.0

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

## Sources

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

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