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

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). 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
    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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.