CVE-2026-5704: Tar: tar: hidden file injection via crafted archives

Published Apr 6, 2026
·
Updated

A flaw was found in tar. A remote attacker could exploit this vulnerability by crafting a malicious archive, leading to hidden file injection with fully attacker-controlled content. This bypasses pre-extraction inspection mechanisms, potentially allowing an attacker to introduce malicious files onto a system without detection.

Other sources

Summary: GNU tar allows malformed archives where non-data-bearing typeflags (symlink, char device, block device, FIFO) contain a non-zero size field, leading to inconsistent behavior between listing (tar -t) and extraction (tar -x). This results in stream desynchronization and enables hidden file injection. Requirements to exploit: An attacker only needs the ability to supply a crafted tar archive to a target system that performs pre-extraction inspection using tar -t (or equivalent API) and later extracts it using GNU tar. No privileges or user interaction beyond extraction are required.

Patch Available: no

Version Fixed: N/A

Impact: Hidden file injection with fully attacker-controlled content

Bypass of pre-extraction inspection mechanisms

Single-implementation inconsistency (no cross-tool pipeline required)

Attack complexity: Low (crafted archive is < 3 KB, no special privileges)

Affected typeflags: '2', '3', '4', '6' (4 of 5 non-data typeflags)

Steps to reproduce if available:

Generate a crafted archive with a non-data-bearing typeflag (e.g., chardev) and non-zero size.

List contents

tar -tf crafted.tar

→ injected file is NOT shown

Extract archive:

tar -xf crafted.tar

Observe additional file created on disk that was not present in listing output.

Red Hat

Affected Software

9 affected components
GNU GNU tar
GNU tar
redhat Hardened Images
redhat Enterprise Linux=6.0
redhat Enterprise Linux=7.0
redhat Enterprise Linux=8.0
redhat Enterprise Linux=9.0
redhat Enterprise Linux=10.0
debian/tar<=1.34+dfsg-1+deb11u1, <=1.34+dfsg-1.2+deb12u1, <=1.35+dfsg-3.1, <=1.35+dfsg-4

Event History

Apr 6, 2026
Data Sourced
via Red Hat·01:38 PM
DescriptionSeverityAffected Software
CVE Published
via MITRE·03:17 PM
Data Sourced
via MITRE·03:17 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:16 PM
DescriptionSeverityWeaknessAffected Software
Jun 25, 2026
Data Sourced
via Debian·09:27 PM
DescriptionAffected Software
Data Sourced
via Launchpad·09:27 PM
Description
Jul 16, 2026
Data Sourced
via Ubuntu·11:48 PM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203