CVE-2026-140230: node-tar PathReservations.getDirs() quadratic memory amplification via unbounded symlink linkpath depth — uncatchable OOM process kill
node-tar is a tar archive manipulation library for Node.js. Prior to 8.0.0, extraction of a crafted archive with a shallow entry path and deeply nested entry.linkpath bypasses the maxDepth guard and drives quadratic PathReservations.getDirs() allocation. A small crafted archive can exhaust the available Node.js heap and terminate the process. This issue is fixed in version 8.0.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
node-tarto a version that resolves this vulnerability.Fixed in 8.0.0
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications using node-tar versions before 8.0.0 are exposed when they extract attacker-crafted tar archives. The impact is exhaustion of the available Node.js heap and termination of the process.
What does an attacker need to exploit it?
An attacker needs to provide a crafted tar archive containing a shallow entry path with a deeply nested entry.linkpath. The crafted archive can be small while causing quadratic memory allocation during extraction.
Does the normal maximum-depth protection prevent exploitation?
No. The crafted linkpath structure bypasses the maxDepth guard, allowing unbounded symlink linkpath depth to trigger the allocation behavior.
How can this be remediated?
Upgrade node-tar to version 8.0.0, which fixes the issue. Until upgrading, avoid extracting untrusted tar archives in affected applications.