GHSA-m9hw-7xfv-wqg7

Suggest an improvement
Source
https://github.com/advisories/GHSA-m9hw-7xfv-wqg7
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/11/GHSA-m9hw-7xfv-wqg7/GHSA-m9hw-7xfv-wqg7.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-m9hw-7xfv-wqg7
Published
2020-11-12T19:36:14Z
Modified
2020-11-12T19:35:53Z
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.

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"
  ]
}
Database specific
{
    "cwe_ids":  [
        "CWE-471"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2020-11-12T19:35:53Z",
    "nvd_published_at":  null,
    "severity":  "HIGH"
}
References

Affected packages

npm / json-logic-js

Package

Name
json-logic-js
View open source insights on deps.dev
Purl
pkg:npm/json-logic-js

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.0.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/11/GHSA-m9hw-7xfv-wqg7/GHSA-m9hw-7xfv-wqg7.json"