CVE-2025-62518 Overview
CVE-2025-62518 is a boundary parsing vulnerability in astral-tokio-tar, a tar archive reading/writing library for async Rust. Versions prior to 0.5.6 contain a flaw that allows attackers to smuggle additional archive entries by exploiting inconsistent PAX/ustar header handling. When processing archives with PAX-extended headers containing size overrides, the parser incorrectly advances stream position based on ustar header size (often zero) instead of the PAX-specified size, causing it to interpret file content as legitimate tar headers.
Critical Impact
This vulnerability enables attackers to craft malicious tar archives that can smuggle hidden entries past security controls, potentially leading to arbitrary file writes or code execution when archives are extracted in trusted contexts.
Affected Products
- astral-tokio-tar versions prior to 0.5.6
- Applications using vulnerable versions of the tokio-tar library
- Astral UV package manager (dependent on tokio-tar)
Discovery Timeline
- October 21, 2025 - CVE-2025-62518 published to NVD
- October 21, 2025 - Last updated in NVD database
Technical Details for CVE-2025-62518
Vulnerability Analysis
This vulnerability stems from a type confusion issue (CWE-843) in how astral-tokio-tar handles the interaction between PAX-extended headers and ustar headers within tar archives. The tar archive format supports multiple header types, including the traditional ustar format and the newer PAX extended format which can override standard header fields including file size.
The vulnerable code path fails to properly reconcile size information between these two header types. When a PAX-extended header specifies a size value that differs from the ustar header's size field, the parser uses the wrong value when calculating stream advancement. This creates a desynchronization between where the parser believes file content ends and where it actually ends.
Root Cause
The root cause is a type confusion vulnerability where the parser incorrectly uses the ustar header's size field (which may be zero or a placeholder value) instead of the authoritative PAX-specified size when advancing the stream position after reading file content. This architectural flaw allows attackers to embed data that will be interpreted as additional tar headers rather than as file content.
The parser's state machine fails to maintain consistency between the size metadata it uses for data consumption versus stream position tracking, creating a window where attacker-controlled content can be injected into the header parsing context.
Attack Vector
An attacker can exploit this vulnerability by crafting a malicious tar archive that contains:
- A PAX-extended header specifying a large file size
- A ustar header with a size field of zero or a small value
- Carefully positioned payload data that aligns with tar header boundaries
- Smuggled entries that appear as legitimate archive members after the parser desynchronizes
The vulnerability is exploitable over the network when applications process untrusted tar archives, such as package managers downloading dependencies or CI/CD systems extracting build artifacts. User interaction is required in the sense that the malicious archive must be processed by a vulnerable application. For detailed technical analysis and proof-of-concept information, see the Edera Tarmageddon Story and the CVE Tarmageddon Repository.
Detection Methods for CVE-2025-62518
Indicators of Compromise
- Unexpected files appearing in extraction directories that were not visible in archive listings
- Tar archives containing PAX headers with size values that differ significantly from corresponding ustar headers
- Anomalous file extraction behavior where extracted content differs from archive preview
- Log entries showing extraction of files not present in original archive manifests
Detection Strategies
- Implement dependency scanning to identify applications using astral-tokio-tar versions prior to 0.5.6
- Deploy file integrity monitoring on systems that extract tar archives from untrusted sources
- Analyze tar archives for header inconsistencies between PAX and ustar size fields before extraction
- Monitor for exploitation attempts using archive analysis tools that can detect smuggled entries
Monitoring Recommendations
- Enable verbose logging for tar extraction operations to capture header parsing details
- Implement post-extraction validation comparing extracted files against archive manifests
- Deploy SentinelOne Singularity to detect anomalous file creation patterns following archive extraction
- Audit Rust application dependencies for vulnerable tokio-tar versions using cargo audit
How to Mitigate CVE-2025-62518
Immediate Actions Required
- Upgrade astral-tokio-tar to version 0.5.6 or later immediately
- Audit all Rust applications for dependencies on vulnerable tokio-tar versions
- Review any archives extracted using vulnerable versions for signs of smuggled entries
- Consider temporarily disabling automated tar extraction from untrusted sources until patched
Patch Information
The vulnerability has been addressed in astral-tokio-tar version 0.5.6. The fix ensures that the parser consistently uses the PAX-specified size when both header types are present, maintaining proper stream synchronization. The patch is available in commit 22b3f884adb7a2adf1d3a8d03469533f5cbc8318. Organizations should update their Cargo.toml dependencies and rebuild affected applications.
For additional context, review the GitHub Security Advisory for tokio-tar and the GitHub Security Advisory for UV.
Workarounds
- No workarounds are available according to the vendor advisory - upgrading to version 0.5.6 is the only remediation path
- As a temporary risk reduction measure, avoid processing tar archives from untrusted sources
- Implement archive validation using alternative tooling before processing with vulnerable applications
- Consider sandboxing tar extraction operations to limit potential impact of smuggled entries
# Update astral-tokio-tar dependency
cargo update -p astral-tokio-tar
# Verify the updated version
cargo tree -p astral-tokio-tar
# Run security audit to check for remaining vulnerabilities
cargo audit
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

