Denial of service while parsing a tar file due to lack of folders count validationGHSA-f5x3-32g6-xq36
MEDIUMFix: isaacs/node-tar@fe8cd57GHSA-f5x3-32g6-xq36 is a medium-severity (CVSS 6.5) Uncontrolled Resource Consumption vulnerability in node-tar. A fix is available for node-tar — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for GHSA-f5x3-32g6-xq36.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, a proxy for how much of the ecosystem is exposed.
node-tarnpmtarnpmDescription
Description:
During some analysis today on npm's node-tar package I came across the folder creation process, Basicly if you provide node-tar with a path like this ./a/b/c/foo.txt it would create every folder and sub-folder here a, b and c until it reaches the last folder to create foo.txt, In-this case I noticed that there's no validation at all on the amount of folders being created, that said we're actually able to CPU and memory consume the system running node-tar and even crash the nodejs client within few seconds of running it using a path with too many sub-folders inside
Steps To Reproduce:
You can reproduce this issue by downloading the tar file I provided in the resources and using node-tar to extract it, you should get the same behavior as the video
Proof Of Concept:
Here's a video show-casing the exploit:
Impact
Denial of service by crashing the nodejs client when attempting to parse a tar archive, make it run out of heap memory and consuming server CPU and memory resources
Report resources
Note
This report was originally reported to GitHub bug bounty program, they asked me to report it to you a month ago
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | node-tar | all versions | 6.2.1npm install node-tar@6.2.1 |
| 📦npm | tar | all versions | 6.2.1npm install tar@6.2.1 |
Affected Products
tarisaacsDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for node-tar, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update node-tar to 6.2.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-f5x3-32g6-xq36 is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Moderate impact in Red Hat products: node-tar is vulnerable to denial of service while parsing a specially crafted tar archive because it does not validate folder depth or count. A remote attacker who can cause a product to process such an archive can exhaust memory and crash the Node.js client. The CVSS 3.1 score is…
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.Source: Red Hat security advisory for GHSA-f5x3-32g6-xq36 (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| OpenShift-Pipelines-1.16-RHEL-8 | openshift-pipelines/pipelines-chains-controller-rhel8:v1.16.0-6 | RHEA-2024:7870 |
| Red Hat Developer Hub 1.2 on RHEL 9 | rhdh/rhdh-hub-rhel9:1.2-132 | RHBA-2024:4924 |
| Red Hat Enterprise Linux 8 | nodejs:20-8100020240808073736.489197e6 | RHSA-2024:5814 |
| Red Hat Enterprise Linux 8 | nodejs:18-8100020240807161023.489197e6 | RHSA-2024:6148 |
| Red Hat Enterprise Linux 9 | nodejs:18-9040020240807131341.rhel9 | RHSA-2024:6147 |
| Red Hat Migration Toolkit for Containers 1.8 | rhmtc/openshift-migration-ui-rhel8:v1.8.4-10 | RHSA-2024:7164 |
| RHODF-4.16-RHEL-9 | odf4/mcg-core-rhel9:v4.16.0-60 | RHSA-2024:4591 |
| RHODF-4.16-RHEL-9 | odf4/ocs-client-console-rhel9:v4.16.2-2 | RHSA-2024:6755 |
Frequently Asked Questions
Is GHSA-f5x3-32g6-xq36 in your dependencies?
Find it across npm, including transitive dependencies.