Read the docs
TI-2021-16593 Aliases CVE-2021-39208GHSA-jp7f-grcv-6mjf

WriteEntryToDirectory used for an archive extraction is vulnerable to partial path traversal.

Priority LOW 22CWE-22Published · Updated

Key facts

Attack vector
Network
Privileges required
Low
User interaction
None
Attack complexity
Low
Impact type
—
Confidentiality · integrity · availability
None · Low · None
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.

Summary

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.

Why it matters now

EPSS 0.01192 68th percentileScored 2026-11-07
Public exploit Yes 1 exploit referenceTagged by NVD
Fix Fixed sharpcompress (adamhathcock): 0.29.0SharpCompress (NuGet): 0.29

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
adamhathcocksharpcompressbefore 0.29.00.29.0Patch availableCNA
—SharpCompress (NuGet)before 0.290.29Patch availableGHSA-jp7f-grcv-6mjf
  • sharpcompress Vendoradamhathcock Affected before 0.29.0 Fixed in 0.29.0 Patch available CNA
  • SharpCompress (NuGet) Vendor— Affected before 0.29 Fixed in 0.29 Patch available GHSA-jp7f-grcv-6mjf

CPE configurations NVD · 1

CPEVersionsRoleVendor
cpe:2.3:a:sharpcompress_project:sharpcompress:*:*:*:*:*:*:*:*before 0.29.0VulnerableSharpcompress Project
  • cpe:2.3:a:sharpcompress_project:sharpcompress:*:*:*:*:*:*:*:* Versions before 0.29.0 Vulnerable ·Sharpcompress Project

Remediation

  • Fix · CNA sharpcompress (adamhathcock) Fixed in 0.29.0
  • Fix · GHSA-jp7f-grcv-6mjf SharpCompress (NuGet) Fixed in 0.29 Advisory →

Timeline

  1. 2026-10-02 Threatist record created from CVE-2021-39208
  2. 2026-10-03 Alias added: GHSA-jp7f-grcv-6mjf

References

  • TI-2026-32672 SharpCompress: Directory traversal via directory entries in WriteToDirectory (zip slip variant) CVSS 3.1MEDIUM 6.5
  • TI-2018-16138 Path traversal in SharpCompress CVSS 3.0MEDIUM 5.5

Sources