Command Injectionorg.mvnpm:shell-quote is a package used to quote and parse shell commands.
Affected versions of this package are vulnerable to Command Injection via the quote function when a { comment } token is followed by a string token containing a line terminator. A { comment } token emits a #-prefixed string that comments out the rest of the shell line, including the opening quote of any subsequent string token. A line terminator inside that subsequent string ends the comment, causing the remainder of the string to be interpreted as shell input - for example, quote(['echo', { comment: 'x' }, 'a\nid;#']) executes id in sh, bash, zsh, ksh, and dash. Because parse emits a comment token for a mid-word # (such as in a URL fragment), appending tokens to parse output is sufficient to reach the vulnerable code path.
How to fix Command Injection? Upgrade org.mvnpm:shell-quote to version 1.11.0 or higher.
| |
Inefficient Algorithmic Complexityorg.mvnpm:shell-quote is a package used to quote and parse shell commands.
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the parseInternal function of parse.js, where parse() finalizes the token list with Array.prototype.concat inside a reduce, copying the entire growing array on every iteration for O(n²) behavior. An attacker can block the single-threaded Node.js event loop and sustain a denial of service by passing a large space-separated string to any code path that calls parse(), with roughly 128 KB stalling the loop for about 15 seconds and 256 KB for about 57 seconds.
How to fix Inefficient Algorithmic Complexity? Upgrade org.mvnpm:shell-quote to version 1.9.0 or higher.
| |