REDHAT-BUG-2480741: High severity npm/shell-quote vulnerability

Published May 22, 2026
·
Updated

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

1 affected component
npm/shell-quote

Event History

May 22, 2026
Data Sourced
via Red Hat·02:01 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of REDHAT-BUG-2480741?

The severity of REDHAT-BUG-2480741 is high with a score of 7.

2

How do I fix REDHAT-BUG-2480741?

To fix REDHAT-BUG-2480741, update to the latest version of shell-quote that addresses this vulnerability.

3

What software is affected by REDHAT-BUG-2480741?

The software affected by REDHAT-BUG-2480741 is npm/shell-quote.

4

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.

5

When was REDHAT-BUG-2480741 published?

REDHAT-BUG-2480741 was published on May 22, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203