Miggo Logo

CVE-2021-25944: deep-defaults vulnerable to prototype pollution

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.84812%
Published
5/24/2022
Updated
4/22/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
deep-defaultsnpm>= 1.0.0, <= 1.0.5

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability documentation explicitly identifies _deepDefaults as the vulnerable function. The function's implementation (visible in lib/index.js) shows it uses _.each to copy properties from src to dest without: 1) validating if the property key is proto or other sensitive prototype properties, 2) checking if properties belong to the object's own properties using hasOwnProperty or equivalent. This allows prototype pollution via malicious src input containing proto payloads, as demonstrated in the PoC. The confidence is high as the analysis matches both the vulnerability description and the actual code implementation.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Ov*rvi*w Prototyp* pollution vuln*r**ility in '***p-****ults' v*rsions *.*.* t*rou** *.*.* *llows *tt**k*r to **us* * **ni*l o* s*rvi** *n* m*y l*** to r*mot* *o** *x**ution. ### **t*ils T** NPM mo*ul* `***p-****ults` **n ** **us** *y Prototyp*

Reasoning

T** vuln*r**ility *o*um*nt*tion *xpli*itly i**nti*i*s _***p****ults *s t** vuln*r**l* *un*tion. T** *un*tion's impl*m*nt*tion (visi*l* in li*/in**x.js) s*ows it us*s _.**** to *opy prop*rti*s *rom sr* to **st wit*out: *) v*li**tin* i* t** prop*rty k*