Miggo Logo

CVE-2019-10805: Exposure of Resource to Wrong Sphere in valib

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.45518%
Published
4/13/2021
Updated
2/1/2023
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
valibnpm<= 2.0.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from valib's inspection functions directly using the object's own hasOwnProperty method. The PoC demonstrates that overriding this method in user-controlled objects affects: 1) isEmpty() (returns false for non-empty objects), 2) countKeys() (reports incorrect key counts), and 3) hasValue() (fails to detect existing values). These functions are vulnerable because they trust the object's potentially compromised hasOwnProperty implementation instead of using the protected Object.prototype.hasOwnProperty method.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

v*li* t*rou** *.*.* *llows Int*rn*l Prop*rty T*mp*rin*. * m*li*iously *r**t** J*v*S*ript o*j**t **n *yp*ss s*v*r*l insp**tion *un*tions provi*** *y v*li*. V*li* us*s * *uilt-in *un*tion (**sOwnProp*rty) *rom t** uns*** us*r-input to *x*min* *n o*j**t

Reasoning

T** vuln*r**ility st*ms *rom v*li*'s insp**tion *un*tions *ir**tly usin* t** o*j**t's own `**sOwnProp*rty` m*t*o*. T** Po* **monstr*t*s t**t ov*rri*in* t*is m*t*o* in us*r-*ontroll** o*j**ts *****ts: *) `is*mpty()` (r*turns **ls* *or non-*mpty o*j**t