CVE-2026-140234: node-tar: Incomplete NUL-byte truncation in ustar, GNU, and PAX names causes name differentials and async crashes

Published Dec 1, 2026
·
Updated

Summary

Names are cut at the first NUL with .replace(/\0./, ''). Without the s flag, . doesn't match \n, \r, U+2028 or U+2029. If one of these follows the NUL, only part of the name is removed, and the NUL remains. The GHSA-gvwx-54wh-qm9j fix (7.5.17, commit 7a635c2) added this regex for PAX values on the assumption that PAX lines can't contain line terminators. The same regex is also used for ustar names and for GNU long-name/long-link data.

Details

| # | Location | Default options | |---|---|---| | VULN-006 | src/header.ts:358 (ustar names); src/parse.ts:390 (GNU L), :397 (GNU K, same regex, not tested separately) | Yes (crash in async x); strip for the differential | | VULN-021 | src/pax.ts:179 (the GHSA-gvwx fix site): CR, U+2028 and U+2029 still end the match | Yes (crash); strip for the differential |

Proof of concept

exploittests/testvuln006 and 021. Each runs a control and an attack against the unmodified 7.5.22 build, with output recorded in exploittests/evidence/. All were run on macOS.

Impact

In async extraction, a name that still contains a NUL reaches fs and throws, which crashes a process that doesn't catch it (the outcome GHSA-gvwx-54wh-qm9j addressed). With strip, the surviving characters make node-tar's view of the name differ from other tools'.

Other sources

node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, /\0./ truncation stops at \n, \r, U+2028 and U+2029, so NUL bytes survive in ustar, GNU and PAX names: a name differential and an async crash. In async extraction, a name that still contains a NUL reaches fs and throws, which crashes a process that doesn't catch it. With strip, the surviving characters make node-tar's view of the name differ from other tools'. The affected security path includes /\0./, \n, \r. This issue is fixed in version 8.0.0.

— MITRE

Affected Software

2 affected componentsFixes available
npm/node-tar<8.0.0
npm/tar<8.0.0
8.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/tar to a version that resolves this vulnerability.

    Fixed in 8.0.0
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 8.0.0

Event History

Dec 1, 2026
CVE Published
via MITRE·05:09 PM
Data Sourced
via MITRE·05:09 PM
DescriptionWeakness
Data Sourced
via OSV·05:09 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:17 PM
DescriptionSeverityWeakness
Dec 2, 2026
Advisory Published
via GitHub·01:45 AM
Data Sourced
via GitHub·01:45 AM
DescriptionWeaknessAffected Software
Data Sourced
via OSV·01:45 AM
Affected Software

Frequently Asked Questions

1

What conditions are required to trigger the crash?

An attacker must supply a tar entry name containing a NUL followed by a newline, carriage return, U+2028, or U+2029 so the NUL survives name handling. The application must perform asynchronous extraction and not catch the filesystem exception raised when that name reaches fs.

2

When can this cause archive-name confusion rather than only a crash?

Name confusion occurs when extraction uses strip. The surviving characters can cause node-tar's interpretation of the entry name to differ from that of other tools.

3

Which archive name formats are affected?

The issue affects ustar, GNU, and PAX entry names.

4

What version resolves the issue?

Upgrade node-tar to version 8.0.0 or later. Versions prior to 8.0.0 are affected.

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