CVE-2026-140235: node-tar parses PAX extended headers by newline-splitting instead of length-delimiting, causing record dropping and forged-field injection

Published Dec 1, 2026
·
Updated

node-tar is a tar archive manipulation library for Node.js. From 7.5.0 until 8.0.0, parseKV splits length-delimited PAX records on newline characters, so a newline inside a record value can drop the original field and turn a trailing fragment into a forged path, size, linkpath, or other entry attribute. Default extraction confines a forged path to the extraction root. When preservePaths is enabled, the forged path may instead be absolute or contain a parent-directory component. This issue is fixed in version 8.0.0.

Affected Software

1 affected component
npm/tar>=7.5.0<8.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. 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:11 PM
Data Sourced
via MITRE·05:11 PM
DescriptionWeakness
Data Sourced
via OSV·05:11 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments face the highest impact from this issue?

Applications that extract attacker-controlled tar archives with node-tar versions from 7.5.0 up to, but not including, 8.0.0 are affected. Risk is higher when extraction uses preservePaths, because forged paths can be absolute or include parent-directory components; default extraction confines forged paths to the extraction root.

2

What must an attacker provide to exploit the flaw?

An attacker needs a crafted tar archive containing PAX extended-header records with a newline inside a length-delimited record value. The newline can cause the intended field to be dropped and a trailing fragment to be interpreted as a forged entry attribute such as path, size, or linkpath.

3

Is the default extraction configuration vulnerable to writing outside the extraction directory?

Default extraction confines a forged path to the extraction root. Extraction configured with preservePaths may allow a forged path to be absolute or contain parent-directory components.

4

What should teams do if they cannot immediately upgrade?

Avoid extracting untrusted tar archives with affected versions, and do not enable preservePaths where possible. Upgrade node-tar to version 8.0.0 when feasible.

5

How can teams determine whether they are affected?

Check whether the application uses npm/tar versions 7.5.0 through versions before 8.0.0 and parses or extracts tar archives. Also review extraction options for preservePaths, especially where archives can be supplied by untrusted sources.

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