{"id":"CVE-2021-32841","published":"2022-01-26T21:10:15Z","modified":"2025-04-22T18:28:07Z","title":"Path Traversal in SharpZipLib","vendor":"icsharpcode","product":"sharpziplib","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":4,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.01115,"percentile":0.66843,"provenance":"source"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"references":[{"url":"https://securitylab.github.com/advisories/GHSL-2021-125-sharpziplib/","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.3","tags":["x_refsource_MISC"]},{"url":"https://github.com/icsharpcode/SharpZipLib/commit/5c3b293de5d65b108e7f2cd0ea8f81c1b8273f78","tags":["x_refsource_MISC"]}],"priority":{"score":16.2,"factors":[{"name":"EPSS percentile","points":13.37},{"name":"CVSS severity","points":2.8}]},"vendorSlug":"icsharpcode","affectedVersions":[{"vendor":"icsharpcode","product":"sharpziplib","versions":[">= 1.3.3, < 1.3.3",">= 1.3.0, < 1.3.0*"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2025-04-22T15:51:36.544375Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"NuGet","package":"SharpZipLib","vulnerableRanges":[">=1.3.0, <1.3.3"],"patched":["1.3.3"],"from":["GHSA-2x7h-96h5-rq84"],"provenance":"source"}],"summary":{"text":"SharpZipLib (icsharpcode, sharpziplib), a Zip, GZip, Tar and BZip2 library, contains a path traversal flaw in its extraction logic: its destination-directory check does not require the destination path to end with a slash. Because of this, when the destination is given without a trailing slash, an attacker supplying a crafted archive can get a file created at a sibling path that shares the destination's prefix, such as /home/user/dir.sh alongside /home/user/dir, and the impact is limited by those constraints.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:31:29Z"},"euvd":{"id":"EUVD-2022-0770","exploited":false,"provenance":"source"}}