Intel

AIKIDO-2026-176842

SharpCompress is vulnerable to Path Traversal

GHSA-rch7-vc9j-fw2vPublished Aug 6, 2026
August 6, 2026

60

CVE Score

Medium

Path Traversal

Are you affected? Scan for Free

TL;DR

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.

How do I fix this?

Upgrade the SharpCompress library to the patch version.

Who does this affect?

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.

Versions

0.0.1 - 0.50.3

Fixed in 0.50.4

Background info

SharpCompress is vulnerable to Path Traversal in versions 0.0.1 - 0.50.3.

Get secure today,
quickly and for free.

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.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea