From a379d31366edbd7a672a981e6c09e185ab448dd3 Mon Sep 17 00:00:00 2001 From: coreybutler Date: Sun, 19 Sep 2021 15:49:17 -0500 Subject: [PATCH] prevent arbitrary command execution. --- lib/cmd.js | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/cmd.js b/lib/cmd.js index b0452cc..0235b38 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -39,6 +39,11 @@ module.exports = { if (!pid){ throw new Error('PID is required for the kill operation.'); } + + if (typeof isNaN(pid)) { + throw new Error('PID must be a number.') + } + callback = callback || function(){}; if (typeof force == 'function'){ callback = force; diff --git a/package.json b/package.json index 050c778..8683b44 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-windows", - "version": "1.0.0-beta.5", + "version": "1.0.0-beta.6", "description": "Support for Windows services, event logging, UAC, and several helper methods for interacting with the OS.", "keywords": [ "ngn",