GHSA-m9hw-7xfv-wqg7: Json logic js Prototype Pollution Vulnerability
HIGHGHSA-m9hw-7xfv-wqg7 is a HIGH prototype pollution vulnerability (CWE-471: Modification of Assumed-Immutable Data (MAID)) affecting Json logic js libraries in the npm ecosystem. The issue involves prototype pollution in json-logic-js. Remediation is available by upgrading affected packages to version 2.0.0.
GHSA-m9hw-7xfv-wqg7 at a Glance
How to Fix GHSA-m9hw-7xfv-wqg7
To remediate this vulnerability, upgrade all affected Json logic js dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install json-logic-js@2.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls json-logic-js
How to Check if You Are Affected
To determine whether your Node.js application is affected by GHSA-m9hw-7xfv-wqg7, inspect your project dependencies using npm:
npm ls json-logic-js
Analyze the terminal output to locate any version of Json logic js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0), your application is affected.
Note: The npm ls json-logic-js command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-471: Modification of Assumed-Immutable Data (MAID), where the product does not properly protect an assumed-immutable element from being modified by an attacker. In Json logic js, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-m9hw-7xfv-wqg7 Affected Json logic js Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
json-logic-js
|
npm |
< 2.0.0
|
2.0.0
|
References
Frequently Asked Questions
What is GHSA-m9hw-7xfv-wqg7?
Which Json logic js versions are affected?
What version fixes GHSA-m9hw-7xfv-wqg7?
Is json-logic-js affected?
What CWE is associated with GHSA-m9hw-7xfv-wqg7?
How can I check npm dependencies for GHSA-m9hw-7xfv-wqg7?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-m9hw-7xfv-wqg7",
"modified" : "2020-11-12T19:35:53Z",
"published" : "2020-11-12T19:36:14Z",
"aliases" : [ ],
"summary" : "Prototype Pollution in json-logic-js",
"details" : "Versions of json-logic-js prior to 2.0.0 are vulnerable to Prototype Pollution. The method operation allows a malicious user to modify the prototype of Object through the method property name. This causes modification of any existing property that will exist on all objects and leads to Remote Code Execution.\n\nThe following rule creates a popup when run from a browser:\n```\n{\n \"method\": [\n {\n \"method\": [\n {\n \"var\": \"__proto__.constructor.is.__proto__\"\n },\n \"constructor\",\n [\n \"var x = 'SECURITY!'; console.log(x, window.fetch); alert(x)\"\n ]\n ]\n },\n \"call\"\n ]\n}\n```",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "json-logic-js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jwadhams/json-logic-js/commit/fadfa5dc7ccd1cc5c9a1900a97a15af390bf642b"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/advisories/1542"
}, {
"type" : "WEB",
"url" : "https://www.npmjs.com/package/json-logic-js"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-471" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-11-12T19:35:53Z",
"nvd_published_at" : null
}
}