CVE-2021-32841
JSON

4.0medium

Path Traversal in SharpZipLib

Severity
4.0medium CVSS:3.1 by GitHub_M
Exploit likelihood
1.11% (higher than 66% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-2x7h-96h5-rq84

Description

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.

Affected

Product or packageVersionsReported by
icsharpcode sharpziplibfrom 1.3.3 before 1.3.3, from 1.3.0 before 1.3.0*CVE List
SharpZipLib (NuGet)from 1.3.0 before 1.3.3GitHub Advisory Database
sharpziplib_project sharpziplibfrom 1.3.0 before 1.3.3NVD

All scores

GitHub_M4.0medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
GitHub4.0medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:P/A:N

Classification

CWE-22

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

SharpZipLib (o #ziplib) es una biblioteca Zip, GZip, Tar y BZip2. A partir de la versión 1.3.0 y versiones anteriores a 1.3.3, fue añadida una comprobación de si el archivo de destino está en el directorio de destino. Sin embargo, no es obligatorio que "destDir" termine en barra. Si "destDir" no termina en barra como "/home/user/dir" es posible crear un fichero con un nombre que empiece por el directorio de destino, por ejemplo "/home/user/dir.sh". Debido a las restricciones del nombre del archivo y del directorio de destino, el impacto de la creación arbitraria de archivos es limitado y depende del caso de uso. La versión 1.3.3 contiene un parche para esta vulnerabilidad

References

Sources

SourceRecordLicence
CVE ListCVE-2021-32841 changed 2025-04-22CVE Terms of Use
GitHub Advisory DatabaseGHSA-2x7h-96h5-rq84 changed 2024-02-19CC-BY-4.0
NVDCVE-2021-32841 changed 2026-06-17Public domain