CVE-2026-18508: Tar: tar: --one-top-level hardlink targets not confined to top-level directory enabling arbitrary file overwrite

Published Jul 31, 2026
·
Updated

A flaw was found in GNU tar. The --one-top-level option is intended to confine extraction under a designated directory, but hardlink targets from the archive are not confined the same way and are resolved relative to the extraction working directory (or the directory given with -C). A crafted archive can create hardlinks inside the --one-top-level directory that point to files outside it. If a suitable symbolic link already exists under the extraction working directory, hardlinking to that symlink can bypass tar's usual symlink-based path protections and allow writing outside the intended top-level directory during a single extraction. Users who rely on --one-top-level as a security boundary when extracting untrusted archives may be affected.

Other sources

A flaw was found in GNU tar. When extracting an archive with the --one-top-level option, hardlink targets are not confined to the designated top-level directory and may resolve relative to the extraction working directory. A crafted archive can create hardlinks that escape the intended boundary and, when combined with a preexisting symbolic link under the working directory, may allow writing outside that boundary during a single extraction.

NVD

Affected Software

6 affected components
GNU tar
GNU tar=1.35
redhat OpenShift Container Platform=4.0
redhat Enterprise Linux=8.0
redhat Enterprise Linux=9.0
redhat Enterprise Linux=10.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    When extracting untrusted archives, do not rely on GNU tar’s --one-top-level option as a security boundary; use a safer extraction approach that prevents hardlink/symlink escape (e.g., extract in a fully isolated sandbox/container with no sensitive writable paths).

Event History

Jul 31, 2026
Data Sourced
via Red Hat·05:05 PM
DescriptionSeverityAffected Software
Aug 3, 2026
CVE Published
via MITRE·02:51 PM
Data Sourced
via MITRE·02:51 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:16 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-18508?

The severity of CVE-2026-18508 is medium, rated at 4.4.

2

How do I fix CVE-2026-18508?

To fix CVE-2026-18508, update GNU tar to the latest patched version that addresses this vulnerability.

3

What are the risks associated with CVE-2026-18508?

CVE-2026-18508 allows arbitrary file overwrites due to improper handling of hardlink targets when using the --one-top-level option.

4

Who is affected by CVE-2026-18508?

Users of GNU tar who extract archives with the --one-top-level option may be affected by CVE-2026-18508.

5

What conditions lead to exploitation of CVE-2026-18508?

Exploitation of CVE-2026-18508 occurs when a crafted archive is used that takes advantage of the hardlink behavior when extracting.

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