CVE & CISA-KEV Catalog

CVE-2021-39208

MEDIUM
4.3
CVSS v3
NVD

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.

How to fix

Remediation Available
sharpcompressNVD
Affected:< 0.29.0Fixed in:0.29.0CVE-2021-39208derived from NVD

Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.

CVSS v3 Vector

Exploitability

Attack VectorNetwork
Attack ComplexityLow
Privileges RequiredLow
User InteractionNone
ScopeUnchanged

Impact

ConfidentialityNone
IntegrityLow
AvailabilityNone

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N

Exploit Intelligence

1.15%probability of exploitation in 30 days
63rdpercentile

Moderate risk: more likely to be exploited than 63% of all known CVEs.

References

Exploit1
Third-Party Advisory1

Related Vulnerabilities

Other CWE-22 (Path Traversal) vulnerabilities, ordered by exploit likelihood. View all

CVESeverityCVSSEPSSExploitedFix
CVE-2024-23897Critical9.8100%KEV + RansomFix
CVE-2023-32315High8.6100%KEVFix
CVE-2022-29464Critical9.8100%KEV + Ransom-
CVE-2021-26086Medium5.3100%KEVFix
CVE-2021-22005Critical9.8100%KEV + RansomFix
CVE-2020-5902Critical9.8100%KEV + RansomFix
Embed a live status badge for CVE-2021-39208
CVE-2021-39208 severity badge

Markdown

[![CVE-2021-39208](https://tridentstack.com/cve/badge/CVE-2021-39208.svg)](https://tridentstack.com/cve/CVE-2021-39208)

HTML

<a href="https://tridentstack.com/cve/CVE-2021-39208"><img src="https://tridentstack.com/cve/badge/CVE-2021-39208.svg" alt="CVE-2021-39208"></a>

Find and fix vulnerabilities across your fleet

TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.

Start free

This product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2024-11-21.