SharpCompress is vulnerable to Path Traversal
60
CVE Score
Medium
Path Traversal
SharpCompress extracts TAR archives through its WriteToDirectory extraction API and checks that each entry's destination path stays under the extraction root. When an application supplies an ExtractionOptions.SymbolicLinkHandler that creates symbolic links, a crafted archive can place a symlink entry whose target resolves outside the root and then a later file entry whose path resolves through that link. The destination prefix check still passes, but the file write follows the symlink at the filesystem level, so externally supplied content is written or overwritten outside the intended extraction directory. The fix rejects symlink targets that resolve outside the destination and refuses to extract entries through existing symbolic links.
Upgrade the SharpCompress library to the patch version.
You are affected if you are using a version that falls within the vulnerable range and your application supplies an ExtractionOptions.SymbolicLinkHandler that creates symbolic links while extracting untrusted TAR archives.
0.0.1 - 0.50.3
Fixed in 0.50.4SharpCompress is vulnerable to Path Traversal in versions 0.0.1 - 0.50.3.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.