GHSA-m9hw-7xfv-wqg7: Json logic js Prototype Pollution Vulnerability

HIGH
CWE-471
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-m9hw-7xfv-wqg7
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-471: Modification of Assumed-Immutable Data (MAID)
Affected Product Json logic js
Package Ecosystem npm
Published Date
Last Updated

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.

json-logic-js fixed: 2.0.0
npm install json-logic-js@2.0.0
Verify Direct and Transitive Dependencies

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

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. The following rule creates a popup when run from a browser: ``` { "method": [ { "method": [ { "var": "__proto__.constructor.is.__proto__" }, "constructor", [ "var x = 'SECURITY!'; console.log(x, window.fetch); alert(x)" ] ] }, "call" ] } ```

GHSA-m9hw-7xfv-wqg7 Affected Json logic js Versions

1 component(s)
Fixed Versions:
2.0.0
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?
GHSA-m9hw-7xfv-wqg7 is a security vulnerability in Json logic js involving Prototype Pollution in json-logic-js under CWE-471: Modification of Assumed-Immutable Data (MAID).
Which Json logic js versions are affected?
Affected versions include releases prior to 2.0.0 across affected packages: json-logic-js.
What version fixes GHSA-m9hw-7xfv-wqg7?
Upgrading to 2.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is json-logic-js affected?
Yes, json-logic-js is affected in releases prior to 2.0.0. Upgrade your dependency to 2.0.0 or later.
What CWE is associated with GHSA-m9hw-7xfv-wqg7?
GHSA-m9hw-7xfv-wqg7 is classified under CWE-471: Modification of Assumed-Immutable Data (MAID) (The product does not properly protect an assumed-immutable element from being modified by an attacker.).
How can I check npm dependencies for GHSA-m9hw-7xfv-wqg7?
Run the dependency tree command: 'npm ls json-logic-js'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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
  }
}