CVE-2026-140238: node-tar: Newline injection in PAX extended-header records enables entry-attribute forgery (path overwrite → npm postinstall RCE on Windows)

Published Dec 1, 2026
·
Updated

node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, newline splitting of PAX extended header records permits attacker-controlled entry attributes to be forged. Direct node-tar extraction without strip can overwrite a path within the extraction target. The npm execution chain additionally requires Windows strip:1 normalization, an overwrite of package.json, and later execution of the injected postinstall script; POSIX npm processing with strip:1 is not affected by that chain. This issue is fixed in version 8.0.0.

Affected Software

1 affected component
npm/node-tar<8.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

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

    Fixed in 8.0.0

Event History

Dec 1, 2026
CVE Published
via MITRE·05:21 PM
Data Sourced
via MITRE·05:21 PM
DescriptionWeakness
Data Sourced
via OSV·05:21 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to path overwrites during extraction?

node-tar versions prior to 8.0.0 are affected. Direct extraction using node-tar without strip can overwrite a path within the extraction target when processing a crafted archive.

2

What conditions are required for the npm postinstall execution chain?

The described npm chain requires Windows strip:1 normalization, an overwrite of package.json, and subsequent execution of the injected postinstall script. POSIX npm processing with strip:1 is not affected by that chain.

3

How can I determine whether my environment is affected?

Check the node-tar version in use: versions earlier than 8.0.0 are affected. Also identify workflows that extract untrusted tar archives directly without strip, or Windows npm workflows that use strip:1 and may later execute package scripts.

4

What should be done to remediate the issue?

Upgrade node-tar to version 8.0.0, which fixes the issue. Until upgraded, avoid extracting untrusted archives in the affected direct-extraction and Windows npm conditions described.

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