CVE-2021-32842
JSON

4.0medium

Path Traversal in SharpZipLib

Severity
4.0medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.92% (higher than 61% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-mm6g-mmq6-53ff

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.

Affected

Product or packageVersionsReported by
icsharpcode sharpziplibfrom 1.3.3 before 1.3.3, from 1.0.0 before 1.0.0*CVE List
SharpZipLib (NuGet)from 1.0.0 before 1.3.3GitHub Advisory Database
sharpziplib_project sharpziplibfrom 1.0.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.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.

NVD (es)

SharpZipLib (o #ziplib) es una biblioteca Zip, GZip, Tar y BZip2. A partir de la versión 1.0.0 y versiones anteriores a 1.3.3, fue añadida una comprobación de si el archivo de destino está bajo un directorio de destino. Sin embargo, no es exigido que "_baseDirectory" termine en barra. Si el directorio base no termina en barra como "/home/usuario/dir" es posible crear un archivo con un nombre que comienza como el directorio de destino un nivel más arriba del directorio, por ejemplo "/home/usuario/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 ha corregido esta vulnerabilidad

References

Sources

SourceRecordLicence
CVE ListCVE-2021-32842 changed 2025-04-22CVE Terms of Use
GitHub Advisory DatabaseGHSA-mm6g-mmq6-53ff changed 2024-02-19CC-BY-4.0
NVDCVE-2021-32842 changed 2026-06-17Public domain