Miggo Logo

CVE-2024-12905: tar-fs Vulnerable to Link Following and Path Traversal via Extracting a Crafted tar File

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.62472%
Published
3/27/2025
Updated
3/28/2025
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
tar-fsnpm< 1.16.41.16.4
tar-fsnpm>= 2.0.0, < 2.1.22.1.2
tar-fsnpm>= 3.0.0, < 3.0.73.0.8

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability manifests in symlink/hardlink processing during extraction. The patch adds critical path validation in onsymlink (via inCwd check) and hardens path resolution in onlink. The vulnerable versions lacked these checks, allowing malicious tar entries to write outside cwd. exports.extract is the main entry point where cwd normalization was insufficient, and its inner functions onsymlink/onlink directly handled untrusted input without proper validation.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n Improp*r Link R*solution ***or* *il* ****ss ("Link *ollowin*") *n* Improp*r Limit*tion o* * P*t*n*m* to * R*stri*t** *ir**tory ("P*t* Tr*v*rs*l"). T*is vuln*r**ility o**urs w**n *xtr**tin* * m*li*iously *r**t** t*r *il*, w*i** **n r*sult in un*ut*

Reasoning

T** vuln*r**ility m*ni**sts in symlink/**r*link pro**ssin* *urin* *xtr**tion. T** p*t** ***s *riti**l p*t* `v*li**tion` in `onsymlink` (vi* in*w* ****k) *n* **r**ns p*t* r*solution in `onlink`. T** vuln*r**l* v*rsions l**k** t**s* ****ks, *llowin* m*