REDHAT-BUG-2480741: High severity npm/shell-quote vulnerability
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 newline as a command separator, so any content after it would execute as a second command. The vulnerable code path is reachable in two ways: (1) direct construction of { op: '...\n...' } from external input, and (2) via parse(cmd, envFn) when envFn returns object tokens whose .op is attacker-influenced. Both are documented API surface. Fixed by replacing the per-character escape with strict shape validation: .op must match the parser's control-operator allowlist; { op: 'glob', pattern } validates pattern and forbids line terminators; { comment } validates comment and forbids line terminators; any other object shape throws TypeError.
Affected Software
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2480741?
The severity of REDHAT-BUG-2480741 is high with a score of 7.
How do I fix REDHAT-BUG-2480741?
To fix REDHAT-BUG-2480741, update to the latest version of shell-quote that addresses this vulnerability.
What software is affected by REDHAT-BUG-2480741?
The software affected by REDHAT-BUG-2480741 is npm/shell-quote.
What does the vulnerability REDHAT-BUG-2480741 affect in shell-quote?
REDHAT-BUG-2480741 affects the `quote()` function that did not properly validate object-token inputs.
When was REDHAT-BUG-2480741 published?
REDHAT-BUG-2480741 was published on May 22, 2026.