Miggo Logo

CVE-2021-4329: json-logic-js Command Injection vulnerability

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.71859%
Published
3/5/2023
Updated
9/23/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
json-logic-jsnpm< 2.0.12.0.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from two key issues in operation resolution:

  1. The original check 'typeof operations[op] === "function"' allowed prototype chain pollution as it didn't verify if 'op' was a direct property.
  2. The sub-operation resolution loop didn't validate if intermediate properties were own properties, enabling traversal of polluted prototype properties. The patch added hasOwnProperty checks to prevent accessing inherited properties, confirming these were the vulnerable code paths. This matches the CWE-77 command injection pattern where uncontrolled operation names could execute arbitrary functions.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

* vuln*r**ility, w*i** w*s *l*ssi*i** *s *riti**l, **s ***n *oun* in json-lo*i*-js *.*.*. *****t** *y t*is issu* is som* unknown *un*tion*lity o* t** *il* lo*i*.js. T** m*nipul*tion l***s to *omm*n* inj**tion. Up*r**in* to v*rsion *.*.* is **l* to **

Reasoning

T** vuln*r**ility st*ms *rom two k*y issu*s in op*r*tion r*solution: *. T** ori*in*l ****k 'typ*o* op*r*tions[op] === "*un*tion"' *llow** prototyp* ***in pollution *s it *i*n't v*ri*y i* 'op' w*s * *ir**t prop*rty. *. T** su*-op*r*tion r*solution loo