{"schemaVersion":3,"id":"CVE-2021-32842","aliases":["UBUNTU-CVE-2021-32842","GHSA-mm6g-mmq6-53ff"],"status":"published","duplicateOf":null,"title":null,"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.","dates":{"published":"2022-01-26T21:10:10.000Z","modified":"2025-04-22T18:32:19.882Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":5.3,"severity":"medium","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":4,"severity":"medium","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","score":5.3,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","exploitability":10,"impact":2.3,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Nuget","score":4,"severity":"medium","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","exploitability":6.4,"impact":2.3,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":5.3,"severity":"medium","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":5,"severity":"medium","vector":"AV:N/AC:L/Au:N/C:N/I:P/A:N","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00895,"percentile":0.58871,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.00895},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00895,"percentile":0.58871}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00895,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.00895,"percentile":0.58871}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"GITHUB_ADVISORIES_GHSL-2021-125-SHARPZIPLIB","name":"Ghsl 2021 125 Sharpziplib","source":"github","url":"https://securitylab.github.com/advisories/GHSL-2021-125-sharpziplib/","maturity":"poc","reliabilityScore":0.3,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')","description":"The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.","type":"weakness","status":"Stable","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/22.html"}],"affected":[{"vendor":"ubuntu","product":"mono","name":"mono","label":"mono","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/mono","purlType":"deb","versions":[{"text":"All versions","noFixRecorded":true,"fixedIn":null}],"versionsText":"All versions (No fix recorded)","eol":null,"hubHref":null},{"vendor":"icsharpcode","product":"sharpziplib","name":"sharpziplib","label":"sharpziplib","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 1.3.3, < 1.3.3","noFixRecorded":false,"fixedIn":null},{"text":"≥ 1.0.0, < 1.0.0*","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 1.3.3, < 1.3.3 | ≥ 1.0.0, < 1.0.0*","eol":null,"hubHref":"/vendor/icsharpcode/sharpziplib"},{"vendor":"NuGet","product":"SharpZipLib","name":"SharpZipLib","label":"SharpZipLib","ecosystem":"NuGet","cpePart":null,"purl":"pkg:nuget/SharpZipLib","purlType":"nuget","versions":[{"text":"≥ 1.0.0, < 1.3.3","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 1.0.0, < 1.3.3","eol":null,"hubHref":null},{"vendor":"sharpziplib_project","product":"sharpziplib","name":"sharpziplib","label":"sharpziplib","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 1.0.0, < 1.3.3","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 1.0.0, < 1.3.3","eol":null,"hubHref":"/vendor/sharpziplib_project/sharpziplib"}],"affectedCount":4,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://securitylab.github.com/advisories/GHSL-2021-125-sharpziplib/","label":"securitylab.github.com/advisories/GHSL-2021-125-sharpziplib/","hostname":"securitylab.github.com","tags":["X Refsource CONFIRM","REPORT","Exploit","Third Party Advisory"]},{"url":"https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.3","label":"github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.3","hostname":"github.com","tags":["X Refsource MISC","REPORT","WEB","Release Notes","Third Party Advisory"]},{"url":"https://ubuntu.com/security/CVE-2021-32842","label":"ubuntu.com/security/CVE-2021-32842","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-32842","label":"www.cve.org/CVERecord?id=CVE-2021-32842","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32842","label":"nvd.nist.gov/vuln/detail/CVE-2021-32842","hostname":"nvd.nist.gov","tags":["Advisory"]},{"url":"https://github.com/icsharpcode/SharpZipLib","label":"github.com/icsharpcode/SharpZipLib","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://securitylab.github.com/advisories/GHSL-2021-125-sharpziplib","label":"securitylab.github.com/advisories/GHSL-2021-125-sharpziplib","hostname":"securitylab.github.com","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2022-01-26T21:10:10.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2025-04-22T18:32:19.882Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":31,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-21T07:53:05.427Z","stale":false,"partial":false}}