Intel

AIKIDO-2026-176842

SharpCompress is vulnerable to Path Traversal

Path TraversalGHSA-rch7-vc9j-fw2v Published Yesterday

60

Medium Risk

This Affects:

DOTNETSharpCompress
0.0.1 - 0.50.3
Fixed in 0.50.4
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.

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.

Background info

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

How to fix this

Upgrade the SharpCompress library to the patch version.