Command injection via whitespace escaping failure
Published Aug 1, 2022 · Updated Apr 22, 2025
Command injection in Eric Cornelissen Shescape 1.4.0 through 1.5.7 allows attackers to execute arbitrary shell commands via crafted input. The escape and escapeAll functions, when interpolation is enabled, fail to neutralize whitespace and line terminators before shell metacharacters. Exploitation requires a consuming application to pass attacker-controlled input with whitespace to either function and interpolate the result into Bash, Dash, Zsh, or PowerShell command text.
Summary
What happened
Command injection in Eric Cornelissen Shescape 1.4.0 through 1.5.7 allows attackers to execute arbitrary shell commands via crafted input. The escape and escapeAll functions, when interpolation is enabled, fail to neutralize whitespace and line terminators before shell metacharacters. Exploitation requires a consuming application to pass attacker-controlled input with whitespace to either function and interpolate the result into Bash, Dash, Zsh, or PowerShell command text.
The record
- CVE
- CVE-2022-31180
- Published
- Aug 1, 2022
- Updated
- Apr 22, 2025
- Vendor
- Eric Cornelissen
- Product
- Shescape
- Classifications
- CWE-150, CWE-200, T1059
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Aug 1, 2022CVE publishedPublication date reported by the CVE source.
- Apr 22, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=>=1.4.0 < 1.5.8
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- Shescape interpolation command-injection exampleproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo