CVE-2026-44788
Analyzed Analyzed - Analysis Complete
Path Traversal and Arbitrary File Write in SharpCompress

Publication date: 2026-05-26

Last updated on: 2026-06-05

Assigner: GitHub, Inc.

Description
SharpCompress is a fully managed C# library to deal with many compression types and formats. In 0.47.4 and earlier, a path traversal vulnerability in IArchive.WriteToDirectory() allows a malicious archive to create directories outside the intended extraction root. For TAR archives, this can be escalated to arbitrary file writes by chaining with a symlink entry, giving a full write primitive on the target filesystem subject to the permissions of the running process.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-05-26
Last Modified
2026-06-05
Generated
2026-06-16
AI Q&A
2026-05-27
EPSS Evaluated
2026-06-14
NVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
adamhathcock sharpcompress to 0.47.4 (inc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-22 The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
Attack-Flow Graph
AI Quick Actions
Instant insights powered by AI
Executive Summary

This vulnerability exists in the SharpCompress library, a C# library used for handling various compression formats. In versions 0.47.4 and earlier, there is a path traversal flaw in the IArchive.WriteToDirectory() function. This flaw allows a maliciously crafted archive to create directories outside the intended extraction folder.

For TAR archives specifically, this vulnerability can be exploited further by chaining it with a symbolic link entry, enabling arbitrary file writes on the target filesystem. The ability to write files depends on the permissions of the process running the extraction.

Impact Analysis

This vulnerability can lead to unauthorized file creation or modification outside the intended extraction directory. An attacker could potentially overwrite critical system or application files if the process has sufficient permissions.

Such unauthorized writes could compromise system integrity, lead to privilege escalation, or enable further attacks by placing malicious files on the system.

Compliance Impact

The vulnerability in SharpCompress allows malicious archives to create directories outside the intended extraction root and, in some cases, write arbitrary files on the filesystem. This can lead to unauthorized modification or creation of files, which may compromise data integrity and security.

Such unauthorized file writes and potential privilege escalations could result in violations of data protection standards and regulations like GDPR and HIPAA, which require strict controls over data access, integrity, and confidentiality.

Organizations using affected versions of SharpCompress without proper mitigation may risk non-compliance due to the possibility of attackers manipulating or injecting files, potentially exposing sensitive personal or health information.

Detection Guidance

Detection of this vulnerability involves identifying usage of the SharpCompress library version 0.47.4 or earlier, specifically where the WriteToDirectory() method is called on untrusted archives.

Since the vulnerability allows path traversal and arbitrary file writes via crafted archives, detection can include monitoring for unusual directory creation outside expected extraction roots or unexpected file writes after archive extraction.

There is no direct command provided to detect exploitation, but you can check for suspicious extraction activity by monitoring filesystem changes or scanning for archives containing path traversal patterns like "../" or absolute paths.

  • Use file integrity monitoring tools to detect unexpected file creations or modifications outside normal directories.
  • Manually inspect archives before extraction for entries with relative path traversal sequences (e.g., ../../evil) or absolute paths.
  • If you have access to the system logs or application logs, look for errors or warnings related to archive extraction or unexpected directory creation.
Mitigation Strategies

The primary mitigation is to upgrade the SharpCompress library to a version later than 0.47.4 where the vulnerability is fixed.

If upgrading is not immediately possible, avoid extracting untrusted TAR or ZIP archives using the WriteToDirectory() method.

Ensure that any symbolic link handlers used during TAR extraction validate the link targets to prevent arbitrary file writes.

Apply path validation logic to normalize and check paths before extraction, ensuring no files or directories are created outside the intended extraction root.

Restrict permissions of the process performing extraction to limit the impact of potential exploitation.

Chat Assistant
Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-44788. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70
EPSS Chart