Miggo Logo

CVE-2021-4245: npm package rfc6902 vulnerable to Prototype Pollution

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.58881%
Published
12/15/2022
Updated
1/25/2024
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
rfc6902npm< 5.0.05.0.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the token-processing loop in Pointer's implementation. The pre-patch code in pointer.ts iterated through path tokens and directly assigned values using value = (parent || {})[key] without checking for dangerous keys. The patch adds a guard clause to skip proto/constructor/prototype keys, confirming this was the injection point. The evaluate method (implied by the token traversal logic) is responsible for resolving JSON pointers, making it the logical location for this prototype pollution vulnerability.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

* vuln*r**ility *l*ssi*i** *s pro*l*m*ti* **s ***n *oun* in ***rown r******. T*is *****ts *n unknown p*rt o* t** *il* point*r.ts. T** m*nipul*tion l***s to improp*rly *ontroll** mo*i*i**tion o* o*j**t prototyp* *ttri*ut*s ('prototyp* pollution'). T**

Reasoning

T** vuln*r**ility st*ms *rom t** tok*n-pro**ssin* loop in Point*r's impl*m*nt*tion. T** pr*-p*t** *o** in point*r.ts it*r*t** t*rou** p*t* tok*ns *n* *ir**tly *ssi*n** v*lu*s usin* `v*lu* = (p*r*nt || {})[k*y]` wit*out ****kin* *or **n**rous k*ys. T*