# CVE-2021-32842: Path Traversal in SharpZipLib

- Severity: Medium 4.0 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.92%, higher than 61% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-01-26T21:10:10.000Z
- Modified: 2026-06-17T03:53:44.513Z
- Also known as: GHSA-mm6g-mmq6-53ff
- Weaknesses: CWE-22
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

SharpZipLib (or #ziplib) is a Zip, GZip, Tar and BZip2 library. Starting version 1.0.0 and prior to version 1.3.3, a check was added if the destination file is under a destination directory. However, it is not enforced that `_baseDirectory` ends with slash. If the _baseDirectory is not slash terminated like `/home/user/dir` it is possible to create a file with a name thats begins as the destination directory one level up from the 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 fixed this vulnerability.

(As written by CVE List.)

## Affected

- icsharpcode sharpziplib: from 1.3.3 before 1.3.3; from 1.0.0 before 1.0.0*
- SharpZipLib (NuGet): from 1.0.0 before 1.3.3
- sharpziplib_project sharpziplib: from 1.0.0 before 1.3.3

## Every score

- GitHub_M: CVSS:3.1 4.0 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`
- GitHub: CVSS:3.1 4.0 Medium `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`
- NVD: CVSS:3.1 5.3 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`
- NVD: CVSS:2.0 5.0 Medium `AV:N/AC:L/Au:N/C:N/I:P/A:N`

## References

- <https://securitylab.github.com/advisories/GHSL-2021-125-sharpziplib/> (exploit, third-party-advisory)
- <https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.3> (release-notes, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-32842> (advisory)
- <https://github.com/icsharpcode/SharpZipLib> (package)
- <https://securitylab.github.com/advisories/GHSL-2021-125-sharpziplib> (advisory)

## Sources

- CVE List: [CVE-2021-32842](https://www.cve.org/CVERecord?id=CVE-2021-32842), CVE Terms of Use, modified 2025-04-22
- GitHub Advisory Database: [GHSA-mm6g-mmq6-53ff](https://github.com/advisories/GHSA-mm6g-mmq6-53ff), CC-BY-4.0, modified 2024-02-19
- NVD: [CVE-2021-32842](https://nvd.nist.gov/vuln/detail/CVE-2021-32842), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-32842 · Whole record: https://cve.day/CVE-2021-32842.json · Rebuilt by cve.day 2026-11-25T22:58:06.675Z
