# CVE-2016-10541: shell-quote command injection in argument escaping

Source: https://junglewise.ai/threats/cve-2016-10541-shell-quote-command-injection-in-argument-escaping  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2019-02-18. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2016-10541 · Severity: low · CVSS 3 · Published 2019-02-18

shell-quote is a JavaScript library used to safely escape command-line arguments for shell execution. The library fails to properly escape special characters (semicolons, braces, and other shell metacharacters), allowing attackers to inject arbitrary shell commands. An application using shell-quote to sanitize untrusted input for shell commands could be tricked into executing attacker-controlled code, leading to complete system compromise.

Technologies: [shell-quote (npm)](https://junglewise.ai/threats/technologies/shell-quote). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2016-10541 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2016-10541 being exploited in the wild.

**How severe is CVE-2016-10541?** Low severity, with a CVSS score of 3, published 18 February 2019.

**Which products and versions are affected?** shell-quote (npm) SEMVER:introduced=0,fixed=1.6.1.

**Is there a fix for CVE-2016-10541?** Yes. shell-quote (npm): upgrade to 1.6.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2016-10541 attacked?** It is attacked over the network.

**Am I affected by CVE-2016-10541?** Check whether you run shell-quote (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- shell-quote (npm): upgrade to 1.6.1 or later

  ```sh
  npm install shell-quote@1.6.1
  ```


## Technical details

shell-quote is a Node.js library designed to escape arguments for safe shell command execution. The vulnerability is an OS command injection (CWE-78) caused by improper neutralization of shell metacharacters—specifically semicolons, curly braces, and other special characters used in bash brace expansion. An attacker can craft input like 'a;{echo,test,123,234}' which, when passed to shell-quote().quote(), is not properly escaped, allowing the injection of arbitrary commands executed via bash brace expansion syntax. The attack requires no authentication or user interaction; any application using shell-quote to escape untrusted input destined for shell execution is vulnerable. Affected versions are all releases prior to 1.6.1, which introduced proper escaping for these characters.

## Affected products

- shell-quote shell-quote < 1.6.1

## Identifiers

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

## Timeline

- 2018-05-31: disclosed
- 2019-02-18: advisory
- 2019-02-18: patched: Version 1.6.1 released with proper character escaping

## Related threats

- [shell-quote quote() function code injection in comment handling](https://junglewise.ai/threats/cve-2026-102422-shell-quote-s-quote-function-emits-a-comment-token-as-followed)
- [ljharb shell-quote Denial of Service in parse function](https://junglewise.ai/threats/cve-2026-13311-ljharb-shell-quote-denial-of-service-in-parse-function)
- [ljharb shell-quote command injection in quote function](https://junglewise.ai/threats/cve-2026-9277-ljharb-shell-quote-command-injection-in-quote-function)
- [shell-quote command injection via Windows drive letter regex](https://junglewise.ai/threats/cve-2021-42740-shell-quote-command-injection-via-windows-drive-letter-regex)
