CVE-2021-4329: json-logic-js Command Injection vulnerability
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.71859%
CWE
Published
3/5/2023
Updated
9/23/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
json-logic-js | npm | < 2.0.1 | 2.0.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two key issues in operation resolution:
- The original check 'typeof operations[op] === "function"' allowed prototype chain pollution as it didn't verify if 'op' was a direct property.
- 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.