Security advisory
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-32842
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 11:17 UTC · Revision 1
Source evidence
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.
osv:CVE-2021-32842
Complete source record
{
"id": "94ddb01f35f149b952a3b570e97e5b3fbec78c286ec53b7bb0de6159bf5b0556",
"url": "https://osv.dev/vulnerability/CVE-2021-32842",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2021-32842",
"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.",
"evidence": "osv:CVE-2021-32842",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2021-32842",
"aliases": [
"CVE-2021-32842",
"GHSA-mm6g-mmq6-53ff"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/icsharpcode/sharpziplib",
"type": "GIT",
"events": [
{
"introduced": "fa75398a594b80a8945280ae8e7fb2cf1e7dfa70"
},
{
"fixed": "1b1ab013ce1df02d8f27cf582197759c614d9126"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:sharpziplib_project:sharpziplib:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "1.0.0"
},
{
"fixed": "1.3.3"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "1b1ab013ce1df02d8f27cf582197759c614d9126"
}
],
"source": "REFERENCES_TAG",
"original_tag": "v1.3.3"
}
]
}
}
],
"versions": [
"v1.3.2",
"v1.3.1",
"v1.3.0",
"v1.2.0",
"v1.1.0",
"v1.0.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-32842.json"
}
}
],
"modified": "2026-10-20T10:53:46.295618087Z",
"provider": "osv",
"references": [
"https://github.com/icsharpcode/SharpZipLib/releases/tag/v1.3.3",
"https://securitylab.github.com/advisories/GHSL-2021-125-sharpziplib/"
],
"provider_metadata": {}
},
"related_cves": [
{
"value": "CVE-2021-32842",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 384604,
"published_at": "2022-01-26T21:15:13.337+00:00"
}