CVE-2024-28863
Denial of service while parsing a tar file due to lack of folders count validation
Description
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 Maven artifacts (3)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| org.mvnpm » tarvia npm tar | < 6.2.1 | 6.2.1 |
| org.webjars » tarvia npm tar | < 6.2.1 | 6.2.1 |
| org.webjars.npm » tarvia npm tar | < 6.2.1 | 6.2.1 |
Blast radius
84% of the dependent artifacts (16) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 5 |
| 2 hops | 2 |
| 3 hops | 4 |
| 4 hops | 4 |
| 5 hops | 8 |
| 6 hops | 2 |
Most used dependents
- org.webjars.npm » openlayers4 usages
- org.webjars » bin-build4 usages
- org.webjars » bin-wrapper4 usages
- org.webjars.npm » closure-util2 usages
- org.webjars » download2 usages
- org.webjars » imagemin-gifsicle1 usages
- org.webjars » imagemin-jpegtran1 usages
- org.webjars » imagemin-optipng1 usages
- org.webjars » imagemin-pngquant1 usages
- org.webjars.npm » get-down1 usages
- org.webjars » decompress1 usages
- org.webjars » gifsicle1 usages
- org.webjars » jpegtran-bin1 usages
- org.webjars » optipng-bin1 usages
- org.webjars » pngquant-bin1 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
Other ecosystems
Also affects npm (2 packages) . See all on OSV
References
| Advisory | NVD CVE-2024-28863 | nvd.nist.gov |
| Package | isaacs/node-tar | github.com |
| Web | isaacs/node-tar advisory GHSA-f5x3-32g6-xq36 | github.com |
| Web | isaacs/node-tar commit fe8cd57 | github.com |
| Web | advisory/ntap-20240524-0005 | security.netapp.com |
