CVE-2021-32842 json
Path Traversal in SharpZipLib
published 4y ago modified 4mo ago also GHSA-mm6g-mmq6-53ff , EUVD-2022-1102
- cvss
- 4.0
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.9%
- EPSS 0.9% chance of exploitation in 30 days, percentile 59%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- nuget SharpZipLib 1.3.3
- sharpziplib_project sharpziplib 1.3.3
Is CVE-2021-32842 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.
Check with FencerCISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- partial
- Assessed
- last yr.
Exploit prediction
0.90% chance of exploitation in the next 30 days, higher than 59% of all scored CVEs (FIRST EPSS, 2026-11-09).
Exploits and checks
- securitylab.github.com https://securitylab.github.com/advisories/GHSL-2021-125-sharpziplib/ referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 4.0 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| NVD | 3.1 | 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| NVD | 2.0 | 5.0 | AV:N/AC:L/Au:N/C:N/I:P/A:N |
| GitHub | 3.1 | 4.0 | CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| nuget | SharpZipLib | >=1.0.0, <1.3.3 |
1.3.3 |
Affected products
- icsharpcode sharpziplib
Classification
- Weakness
-
- CWE-22 Improper Limitation of a Pathname to a Restricted Directory
References
-
securitylab.github.com
/advisories/GHSL-2021-125-sharpziplib/
exploit, third-party-advisory
-
github.com
/icsharpcode/SharpZipLib/releases/tag/v1.3.3
web, release-notes, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-32842
advisory
-
github.com
/icsharpcode/SharpZipLib
package
-
securitylab.github.com
/advisories/GHSL-2021-125-sharpziplib
advisory
Sources
- CVE List CVE-2021-32842
- GitHub Advisory GHSA-mm6g-mmq6-53ff
- NVD CVE-2021-32842
Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.