Miggo Logo

CVE-2021-4435: Yarn untrusted search path vulnerability

7.8

CVSS Score
3.1

Basic Information

EPSS Score
0.10707%
Published
2/4/2024
Updated
2/5/2024
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
yarnnpm< 1.22.131.22.13

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from Yarn's child process functions (forkp/spawnp/spawn) resolving executables from the current working directory without validation. The patch adds a 'validate' function to these entry points to block execution of local files matching PATHEXT extensions. The functions were vulnerable because they executed programs without ensuring the path wasn't controlled by an attacker via the cwd, matching CWE-426's untrusted search path pattern. High confidence comes from the direct correlation between the patched functions and the vulnerability description in CVE/GHSA.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

*n untrust** s**r** p*t* vuln*r**ility w*s *oun* in Y*rn. W**n * vi*tim runs **rt*in Y*rn *omm*n*s in * *ir**tory wit* *tt**k*r-*ontroll** *ont*nt, m*li*ious *omm*n*s *oul* ** *x**ut** in un*xp**t** w*ys.

Reasoning

T** vuln*r**ility st*ms *rom Y*rn's **il* `pro**ss` *un*tions (*orkp/sp*wnp/sp*wn) r*solvin* *x**ut**l*s *rom t** *urr*nt workin* *ir**tory wit*out `v*li**tion`. T** p*t** ***s * 'v*li**t*' `*un*tion` to t**s* *ntry points to *lo*k *x**ution o* lo**l