{"cve":"CVE-2021-39208","nvd":{"published":"2021-09-16T15:15:07.390","modified":"2026-06-17T04:03:18.913","status":"Modified","description":"SharpCompress is a fully managed C# library to deal with many compression types and formats. Versions prior to 0.29.0 are vulnerable to partial path traversal. SharpCompress recreates a hierarchy of directories under destinationDirectory if ExtractFullPath is set to true in options. In order to prevent extraction outside the destination directory the destinationFileName path is verified to begin with fullDestinationDirectoryPath. However, prior to version 0.29.0, it is not enforced that fullDestinationDirectoryPath ends with slash. If the destinationDirectory 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. This issue is fixed in SharpCompress version 0.29.0.","cvss_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","score":4.3},"cwes":["CWE-22"],"references":["https://github.com/adamhathcock/sharpcompress/pull/614","https://github.com/adamhathcock/sharpcompress/releases/tag/0.29.0","https://github.com/adamhathcock/sharpcompress/security/advisories/GHSA-jp7f-grcv-6mjf","https://github.com/adamhathcock/sharpcompress/pull/614","https://github.com/adamhathcock/sharpcompress/releases/tag/0.29.0"],"products":["sharpcompress_project:sharpcompress"],"source":"nvd","synced_at":"2026-10-19T21:23:41.316049955+00:00"},"epss":{"cve":"CVE-2021-39208","score":0.01192,"percentile":0.68001,"date":"2026-10-31"},"kev":null,"osv":[],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}