CVE-2016-10541: Potential Command Injection in shell-quote

shell-quote Updated 02 Oct 2025

Summary

18/02/2019
Yes i
Critical
9.8

CVE-2016-10541: Potential Command Injection in shell-quote. Affects shell-quote versions < 1.6.1. Fixed in 1.6.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The shell-quote package is an npm package used for escaping command line arguments. It is commonly used to prevent command injection attacks by properly escaping user input. However, affected versions of shell-quote do not properly escape certain characters, such as >, ;, {, and }, which may result in command injection if the library is used to escape user input destined for use as command line arguments.

Vulnerability Detail

The vulnerability in shell-quote arises from the improper escaping of command line arguments. This allows an attacker to inject arbitrary commands into the command line, potentially leading to unauthorized access, data loss, or other malicious activities. The vulnerability is considered critical with a CVSS score of 9.8. The specific issue is related to the lack of proper escaping for characters like >, ;, {, and }. This can be exploited using a technique called "Bash Brace Expansion", which allows the execution of sub-commands without spaces by enclosing them in {} and using , as the argument separator. By injecting malicious commands, an attacker can execute arbitrary code on the system.

How To Fix

Latest published version: 1.12.0 as of 22 Oct 2026

npm install shell-quote@1.12.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.6.1

This is the first release that contains the fix.

npm install shell-quote@1.6.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating to the latest version is not immediately possible, a workaround can be implemented by manually escaping the problematic characters before passing user input to the shell-quote library. For example, instead of directly passing a;{echo,test,123,234} as an argument, it can be escaped as a\;\{echo,test,123,234\}. This ensures that the characters are treated as literal values and not interpreted as command separators or expansions.

Conclusion

The shell-quote package is vulnerable to command injection due to improper escaping of command line arguments. This can be exploited by an attacker to execute arbitrary commands on the system. To mitigate this vulnerability, it is recommended to update to version 1.6.1 or later of the package. If immediate update is not possible, manual escaping of problematic characters can be used as a temporary workaround. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for shell-quote →

Share this vulnerability

FAQ

This vulnerability allows an attacker to execute arbitrary commands on the system, potentially leading to unauthorized access, data loss, or other malicious activities.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and Vulert will analyze it for any open-source vulnerabilities, including this one.

Yes, updating to version 1.6.1 or later of the shell-quote package fixes this vulnerability by properly escaping command line arguments.

Yes, you can manually escape the problematic characters before passing user input to the shell-quote library. This ensures that the characters are treated as literal values and not interpreted as command separators or expansions.

There are no known public exploits for this vulnerability at the moment. However, it is important to update to the latest version or apply the recommended workarounds to prevent potential exploitation.

Related vulnerabilities

Recent vulnerabilities recorded for shell-quote.

How To Fix

Latest published version: 1.12.0 as of 22 Oct 2026

npm install shell-quote@1.12.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.6.1

This is the first release that contains the fix.

npm install shell-quote@1.6.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback