CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-33056

CVE-2026-33056: Arbitrary Directory Permission Modification via Symlink Following in tar-rs

Amit Schendel
Amit Schendel
Senior Security Researcher

Mar 20, 2026·5 min read·34 visits

Executive Summary (TL;DR)

A symlink following flaw in tar-rs <= 0.4.44 allows attackers to modify permissions of arbitrary directories on the host system via crafted tarballs.

The tar-rs library version 0.4.44 and earlier contains a CWE-61 UNIX Symbolic Link (Symlink) Following vulnerability in the directory extraction logic. By utilizing a crafted tar archive containing a symlink and a directory of the same name, an attacker can manipulate directory permissions on the host system.

Vulnerability Overview

The tar-rs library provides archive processing capabilities for Rust applications. Applications utilizing versions 0.4.44 and earlier are susceptible to a UNIX Symbolic Link Following vulnerability (CWE-61) within the directory unpacking module.

During extraction, the library processes directory entries and sets their metadata, including filesystem permissions. The vulnerability manifests when the library processes a directory entry that shares a name with a previously extracted symbolic link. The extraction logic fails to securely differentiate between a concrete directory and a symlink pointing to a directory.

Because the extraction engine evaluates the target of the symlink rather than the symlink itself, subsequent permission modifications are applied to the target path. This logic error allows an attacker to supply a crafted archive that maliciously alters permissions of arbitrary directories outside the intended extraction root.

Root Cause Analysis

The root cause of CVE-2026-33056 resides in the fallback logic of the unpack_dir function within the src/entry.rs file. When tar-rs extracts a directory entry, it calls std::fs::create_dir to instantiate the directory on the filesystem. If a file or symlink already exists at the target path, the Rust standard library returns an AlreadyExists error.

Upon receiving the AlreadyExists error, the tar-rs library attempts to merge the archive contents by verifying if the existing filesystem entity is a directory. The vulnerable implementation performs this verification using the std::fs::metadata function. The std::fs::metadata function inherently resolves symbolic links and returns the metadata of the ultimate target rather than the link itself.

When an attacker provides a symbolic link followed by a directory entry of the same name, the initial extraction creates the symlink. The subsequent extraction of the directory triggers the AlreadyExists error, and std::fs::metadata follows the attacker-controlled symlink. The library then applies the directory's permission bits using a chmod operation against the resolved target path, modifying host system directories.

Code Analysis

An analysis of the vulnerable src/entry.rs code reveals the exact point of failure. The implementation attempts to handle existing directories gracefully but relies on an unsafe metadata query.

// Vulnerable Code (src/entry.rs in v0.4.44)
fs::create_dir(dst).or_else(|err| {
    if err.kind() == ErrorKind::AlreadyExists {
        let prev = fs::metadata(dst);
        if prev.map(|m| m.is_dir()).unwrap_or(false) {
            return Ok(());
        }
    }
    Err(err)
})

The patch applied in version 0.4.45 mitigates this by replacing fs::metadata with fs::symlink_metadata. The symlink_metadata function returns information about the symlink itself without traversing it.

// Patched Code (src/entry.rs in v0.4.45)
fs::create_dir(dst).or_else(|err| {
    if err.kind() == ErrorKind::AlreadyExists {
        let prev = fs::symlink_metadata(dst);
        if prev.map(|m| m.is_dir()).unwrap_or(false) {
            return Ok(());
        }
    }
    Err(err)
})

By querying the symlink directly, m.is_dir() correctly evaluates to false when encountering a symlink. The function subsequently returns an error, preventing the application of directory permissions to an external target.

Exploitation Methodology

Exploiting this vulnerability requires the attacker to construct a specialized tar archive that dictates the sequence of file operations on the victim machine. The archive must contain at least two entries sharing the exact same path name.

The first entry must be a symbolic link pointing to the target directory the attacker wishes to modify, such as /etc/cron.d or a user's .ssh directory. The second entry must be a directory utilizing the identical name as the symlink, carrying the attacker-desired permission mode bits (e.g., 0o777).

When the application processes this archive, it creates the symlink during the first pass. During the second pass, the directory creation fails, triggering the metadata fallback. The extraction engine resolves the link, verifies the external target is a directory, and applies the mode bits from the archive header to the external directory.

Impact Assessment

The vulnerability enables an attacker to perform unauthorized modification of directory permissions across the host system, constrained only by the privileges of the process running tar-rs. The CVSS v4.0 base score is calculated at 5.1 (Medium), reflecting a localized integrity impact with no direct confidentiality or availability compromises.

An adversary cannot read or write arbitrary file contents directly via this vector. However, altering directory permissions serves as a significant secondary attack vector. Modifying a restricted directory to 0o777 grants all local users write access, potentially leading to privilege escalation if the directory hosts critical system binaries or configuration files.

The EPSS score for this vulnerability is 0.00064, placing it in the 19.75th percentile. This low predictive metric indicates that active exploitation in the wild is currently unlikely, though the availability of public proof-of-concept components warrants timely remediation.

Remediation and Hardening

Organizations must update dependencies to tar-rs version 0.4.45 or later. This upgrade addresses the core symlink resolution error within the library's extraction logic.

Beyond patching the library, developers should implement defense-in-depth strategies when processing untrusted archives. The extraction process should execute within an OS-level container or a restricted namespace to limit filesystem access. Capabilities should be dropped to ensure the process only accesses its designated extraction root.

Additionally, applications can utilize libraries like cap-std to strictly enforce capability-based directory interactions. This ensures that even if a path traversal or symlink following flaw exists within a parsing library, the underlying system calls are confined to the intended sandbox, negating the impact of vulnerabilities like CVE-2026-33056.

Official Patches

Alex CrichtonOfficial fix commit in tar-rs repository
GitHubGitHub Security Advisory

Fix Analysis (1)

Technical Appendix

CVSS Score
5.1/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
EPSS Probability
0.06%
Top 80% most exploited

Affected Systems

tar-rs versions 0.4.44 and earlier

Affected Versions Detail

Product
Affected Versions
Fixed Version
tar-rs
Alex Crichton
<= 0.4.440.4.45
AttributeDetail
CWE IDCWE-61
Attack VectorNetwork
CVSS v4.0 Score5.1
EPSS Score0.00064
Exploit Statuspoc
ImpactLow Integrity

MITRE ATT&CK Mapping

T1222.002Unix File and Directory Permissions Modification
Defense Evasion
CWE-61
UNIX Symbolic Link (Symlink) Following

The software, when accessing a file or directory via a symbolic link, does not correctly handle the resolution of the link.

Vulnerability Timeline

Patch authored and committed by Alex Crichton
2026-03-19
CVE-2026-33056 published by GitHub (CNA)
2026-03-20
NVD record published
2026-03-20
GitHub Advisory (GHSA-j4xf-2g29-59ph) published
2026-03-20

References & Sources

  • [1]GHSA-j4xf-2g29-59ph Advisory
  • [2]tar-rs Commit 17b1fd84e632071cb8eef9d3709bf347bd266446
  • [3]NVD CVE-2026-33056
  • [4]CVE.org Record for CVE-2026-33056

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 8 hours ago•GHSA-H5X8-XP6M-X6Q4
7.1

GHSA-H5X8-XP6M-X6Q4: Unvalidated Signature Generation in @jhb.software/payload-cloudinary-plugin

The @jhb.software/payload-cloudinary-plugin exposes an endpoint that performs unvalidated cryptographic signing of Cloudinary API parameters, allowing authenticated users with minimal privileges to forge valid signatures for arbitrary actions. This flaw allows attackers to overwrite remote storage assets, execute unauthorized file uploads, alter asset visibility parameters, trigger SSRF webhooks, and perform directory traversal within Cloudinary repositories.

Alon Barad
Alon Barad
3 views•6 min read
•about 8 hours ago•GHSA-G2GW-Q38M-VJFC
8.7

GHSA-G2GW-Q38M-VJFC: Server-Side Request Forgery and Bearer Token Exfiltration in @merill/lokka

A Server-Side Request Forgery (SSRF) and Bearer Token Exfiltration vulnerability exists in the @merill/lokka (Lokka) Model Context Protocol (MCP) server prior to version 2.1.2. The server constructed Azure Resource Manager request URLs by concatenating user-controlled path parameters directly into destination request strings. By injecting authority-redefinition characters, an attacker can manipulate URL parsing to execute a host-escape attack, forcing the server to send high-privilege Azure Resource Manager (ARM) Bearer tokens to an external attacker-controlled host. This allows complete administrative access to the associated Azure subscriptions.

Alon Barad
Alon Barad
6 views•7 min read
•about 10 hours ago•GHSA-4XGF-CPJX-PC3J
5.3

GHSA-4xgf-cpjx-pc3j: Directory Traversal and Symlink Following in Pydantic Settings

A directory traversal and symlink following vulnerability exists in Pydantic Settings when using the NestedSecretsSettingsSource with nested subdirectory lookups enabled. An attacker capable of writing to the secrets directory can bypass size limitations, read arbitrary host files, or cause a denial-of-service condition via cyclic symlinks.

Amit Schendel
Amit Schendel
2 views•7 min read
•about 11 hours ago•GHSA-H5RG-8P7F-47G2
4.1

GHSA-h5rg-8p7f-47g2: Server-Side Request Forgery (SSRF) in SurrealDB Identity & Access Management (IAM) JWKS Fetcher

A Server-Side Request Forgery (SSRF) vulnerability exists in SurrealDB's Identity & Access Management (IAM) module prior to version 3.1.5. When configuring JSON Web Key Set (JWKS) URLs for token verification, the remote fetcher follows HTTP redirects by default without validating redirect targets against configured network capabilities. This allows high-privileged users to bypass network access limits and perform blind port scanning of internal network resources.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 12 hours ago•GHSA-CC8F-FCX3-GPJR
7.7

GHSA-cc8f-fcx3-gpjr: Arbitrary File Disclosure via DEFINE ANALYZER mapper filter in SurrealDB

A local file disclosure vulnerability exists in SurrealDB's full-text search capabilities, allowing authenticated users with database EDITOR or OWNER roles to read arbitrary files from the host system filesystem. This occurs by abusing the mapper() filter inside a DEFINE ANALYZER statement to point to system files.

Alon Barad
Alon Barad
6 views•6 min read
•about 13 hours ago•GHSA-H4H3-3RFJ-X6FQ
4.3

GHSA-H4H3-3RFJ-X6FQ: Value-Ordering Oracle Side-Channel via Indexed ORDER BY in SurrealDB

SurrealDB versions 3.0.0 through 3.1.4 contain an information exposure vulnerability (CWE-203) where the query planner optimizes sorted queries using indexes on fields with field-level SELECT restrictions. Because the query planner performs index-based sorting before enforcing permission-based redaction, unauthorized users can observe the physical order of returned rows to deduce the relative values of protected fields.

Alon Barad
Alon Barad
4 views•8 min read