CVE-2021-39208
Last modified
CVE-2021-39208 is a medium-severity vulnerability rated 4.3/10 on the CVSS scale. 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. EPSS estimates a 1.15% chance of exploitation in the next 30 days.
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.
Metrics
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
Weakness Enumeration
Affected Software
| Vendor | Product | Versions |
|---|---|---|
| Sharpcompress Project | Sharpcompress | < 0.29.0 |
References
- https://github.com/adamhathcock/sharpcompress/pull/614Patch, Third Party Advisory
- https://github.com/adamhathcock/sharpcompress/releases/tag/0.29.0Release Notes, Third Party Advisory
- https://github.com/adamhathcock/sharpcompress/security/advisories/GHSA-jp7f-grcv-6mjfExploit, Third Party Advisory
- https://github.com/adamhathcock/sharpcompress/pull/614Patch, Third Party Advisory
- https://github.com/adamhathcock/sharpcompress/releases/tag/0.29.0Release Notes, Third Party Advisory
- https://github.com/adamhathcock/sharpcompress/security/advisories/GHSA-jp7f-grcv-6mjfExploit, Third Party Advisory
Timeline
- Published
- Last Modified
- Status
- Modified
Frequently Asked Questions
What is CVE-2021-39208?
How severe is CVE-2021-39208?
How do I fix CVE-2021-39208?
How Strix Helps
- How Strix found a critical auth bypass in etcdStrix autonomously discovered a critical authentication bypass in etcd, later designated CVE-2026-33413.
- Autonomous PentestingAI agents that find and validate exploitable vulnerabilities like this one across your applications.
- PR ReviewsPentest every pull request so vulnerable code is caught before it ships to production.
- AI Penetration TestingHow AI-driven penetration testing continuously covers your attack surface.
Related CVEs from 2021
- CVE-2021-39202WordPress is a free and open-source content management syste…5.4
- CVE-2021-39203WordPress is a free and open-source content management syste…6.5
- CVE-2021-39204Pomerium is an open source identity-aware access proxy. Envo…7.5
- CVE-2021-39205Jitsi Meet is an open source video conferencing application.…6.1
- CVE-2021-39206Pomerium is an open source identity-aware access proxy. Envo…8.6
- CVE-2021-39207parlai is a framework for training and evaluating AI models …8.8
- CVE-2021-39209GLPI is a free Asset and IT management software package. In …8.8
- CVE-2021-3921firefly-iii is vulnerable to Cross-Site Request Forgery (CSR…4.3
- CVE-2021-39210GLPI is a free Asset and IT management software package. In …6.5
- CVE-2021-39211GLPI is a free Asset and IT management software package. Sta…5.3
- CVE-2021-39212ImageMagick is free software delivered as a ready-to-run bin…3.6
- CVE-2021-39213GLPI is a free Asset and IT management software package. Sta…8.8
Are you affected by CVE-2021-39208?
Run a free Strix scan to check your systems for this vulnerability.
Scan your code nowSource: NVD / NIST
