Executive brief
tree-kill is a Node.js library used to terminate processes and their child processes across platforms. On Windows systems, the library fails to properly sanitize user-supplied input before passing it to a shell command, allowing an attacker who controls the process ID parameter to execute arbitrary shell commands with the privileges of the running process.
Technical details
The vulnerability is a code injection flaw (CWE-94) in the Windows code path of tree-kill. While the Linux implementation properly sanitizes input passed to the kill command, the Windows path concatenates unsanitized user input directly into an exec() call without validation. An attacker who can control the process ID argument supplied to the kill() function can inject shell metacharacters (e.g., & or |) to execute arbitrary commands. The attack is network-adjacent if the input comes from a remote source, but typically requires the application using tree-kill to pass attacker-controlled data to the kill() function. Patches were released in version 1.2.2 and later.
Affected products
- pkrumins tree-kill 1.2.1 and earlier
Timeline
- 2019-12-18: disclosed
- 2022: patched: Fix released in version 1.2.2
- 2022-05-24: advisory: GHSA advisory published
- 2023-11-08: other: Advisory withdrawn as duplicate of GHSA-884p-74jh-xrg2