Skip to content

← Public intelligence

npm package

shell-quote

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

5 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Critical, CVSS 9.2npmAmendedPublished

    shell-quote: quote() command injection via a line terminator in a token after a { comment } token

    CVE-2026-102422 · GHSA-pqg4-j6r4-53mv

    Affected
    • npm shell-quote >= 1.8.4, < 1.11.0
    Fixed in
    1.11.0· Vendor fix available
    Issue
    Impact quote() emits a { comment } token as followed by its text, which comments out the rest of the shell line, including the opening quote of any later string token. A line terminator in that later string ends the comment, and the rest of the string is parsed as shell input: Passed to sh, bash, dash, ksh, or zsh, this runs id. parse() emits a comment token for a in the middle of a word (for example http://example.com/#frag), so callers that combine parse() output with another untrusted string, such as quote(parse(untrustedCommand).concat(untrustedArg)), are affected. The fix for CVE-2026-9277 rejected line terminators in the comment's own text, but not in the tokens after it. Exploitation requires an attacker-controlled string containing a line terminator that follows a { comment } token in the same quote() call. Patches Fixed in v1.11.0: quote() throws a TypeError when a string after a { comment } token contains a line terminator (\n, \r, U+2028, or U+2029). Workarounds Drop…

    Recommended action: Upgrade to 1.11.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.com (1)osv.dev (2)Source checked Evidence →
  2. High, CVSS 8.7npmAmendedPublished

    shell-quote: Quadratic-complexity Denial of Service in parse() (CWE-407)

    CVE-2026-13311 · GHSA-395f-4hp3-45gv

    Affected
    • npm shell-quote <= 1.8.4
    Fixed in
    1.9.0· Vendor fix available
    Issue
    shell-quote's parse() finalizes its token list with a reduce that uses Array.prototype.concat as the accumulator. Each prev.concat(arg) copies the entire growing array, so parse() runs in O(n²) in the number of tokens. An unauthenticated attacker who can submit a string to any code path that calls parse() on it can block the single-threaded Node.js event loop for tens of seconds with a small input — a denial of service. The trigger needs no shell metacharacters (plain space-separated words suffice), so input filters that only screen for ;, |, $, or backticks do not help. Root cause parse.js (lines 200–203), in parseInternal — this path runs on every parse() call: prev.concat(arg) allocates a new array and copies all of prev on every iteration, so producing an N-token result costs 1 + 2 + … + N = O(N²) copies. A second acc.concat(s) reduce in the module.exports wrapper (lines 211–224, reached only when env is a function) has the same shape. The maintainer's own // TODO:…

    Recommended action: Upgrade to 1.9.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  3. Critical, CVSS 9.2npmAmendedPublished

    shell-quote quote() does not escape newlines in object .op values

    CVE-2026-9277 · GHSA-w7jw-789q-3m8p

    Affected
    • npm shell-quote >= 1.1.0, <= 1.8.3
    Fixed in
    1.8.4· Vendor fix available
    Issue
    shell-quote's quote() function did not validate object-token inputs against the operator model used by parse(). The .op field was backslash-escaped character by character using /(.)/g, which in JavaScript does not match line terminators (\n, \r, U+2028, U+2029). A line terminator in .op therefore passed through unescaped into the output; POSIX shells treat a literal \n as a command separator, so any content after it would execute as a second command. The vulnerable code path is reachable in two ways. Neither requires the parser to misbehave — parse() only emits ops from a fixed control set — but both are documented API surface: 1. Direct construction. A caller builds { op: '...\n...' } from external input (e.g. a deserialized argument array) and passes it to quote(). 2. envFn return. parse(cmd, envFn) is documented to splice the return value of envFn into the result array when it is an object. An attacker-influenced data source consulted by envFn can introduce an object token…

    Recommended action: Upgrade to 1.8.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.com (1)osv.dev (2)Source checked Evidence →
  4. Critical, CVSS 9.8npmAmendedPublished

    Improper Neutralization of Special Elements used in a Command in Shell-quote

    CVE-2021-42740 · GHSA-g4rg-993r-mgx7

    Affected
    • npm shell-quote >= 1.6.3, <= 1.7.2
    Fixed in
    1.7.3· Vendor fix available
    Issue
    The shell-quote package before 1.7.3 for Node.js allows command injection. An attacker can inject unescaped shell metacharacters through a regex designed to support Windows drive letters. If the output of this package is passed to a real shell as a quoted argument to a command with exec(), an attacker can inject arbitrary commands. This is because the Windows drive letter regex character class is [A-z] instead of the correct [A-Za-z]. Several shell metacharacters exist in the space between capital letter Z and lower case letter a, such as the backtick character.

    Recommended action: Upgrade to 1.7.3 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  5. Critical, CVSS 9.8npmAmendedPublished

    Potential Command Injection in shell-quote

    CVE-2016-10541 · GHSA-qg8p-v9q4-gh34

    Affected
    • npm shell-quote < 1.6.1
    Fixed in
    1.6.1· Vendor fix available
    Issue
    Affected versions of shell-quote do not properly escape command line arguments, which may result in command injection if the library is used to escape user input destined for use as command line arguments. Proof of Concept: The following characters are not escaped properly: ,;,{,} Bash has a neat but not well known feature known as "Bash Brace Expansion", wherein a sub-command can be executed without spaces by running it between a set of {} and using the , instead of to seperate arguments. Because of this, full command injection is possible even though it was initially thought to be impossible. Recommendation Update to version 1.6.1 or later.

    Recommended action: Upgrade to 1.6.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →