CVE & CISA-KEV Catalog

CVE-2022-31180

CRITICALEPSS 71th pctl
9.8
CVSS v3
NVD

Description

Shescape is a simple shell escape package for JavaScript. Affected versions were found to have insufficient escaping of white space when interpolating output. This issue only impacts users that use the `escape` or `escapeAll` functions with the `interpolation` option set to `true`. The result is that if an attacker is able to include whitespace in their input they can: 1. Invoke shell-specific behaviour through shell-specific special characters inserted directly after whitespace. 2. Invoke shell-specific behaviour through shell-specific special characters inserted or appearing after line terminating characters. 3. Invoke arbitrary commands by inserting a line feed character. 4. Invoke arbitrary commands by inserting a carriage return character. Behaviour number 1 has been patched in [v1.5.7] which you can upgrade to now. No further changes are required. Behaviour number 2, 3, and 4 have been patched in [v1.5.8] which you can upgrade to now. No further changes are required. The best workaround is to avoid having to use the `interpolation: true` option - in most cases using an alternative is possible, see the recipes for recommendations. Alternatively, users may strip all whitespace from user input. Note that this is error prone, for example: for PowerShell this requires stripping `'\u0085'` which is not included in JavaScript's definition of `\s` for Regular Expressions.

How to fix

Remediation Available
shescapeNVD
Affected:>= 1.4.0, < 1.5.8Fixed in:1.5.8CVE-2022-31180derived from NVD

Remediation is compiled from vendor and distribution security advisories. Always confirm against the linked source for your exact version and platform.

CVSS v3 Vector

Exploitability

Attack VectorNetwork
Attack ComplexityLow
Privileges RequiredNone
User InteractionNone
ScopeUnchanged

Impact

ConfidentialityHigh
IntegrityHigh
AvailabilityHigh

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Exploit Intelligence

1.51%probability of exploitation in 30 days
71stpercentile

Elevated risk: more likely to be exploited than 71% of all known CVEs.

References

Exploit1
Third-Party Advisory2

Related Vulnerabilities

Other CWE-74 (Injection) vulnerabilities, ordered by exploit likelihood. View all

CVESeverityCVSSEPSSExploitedFix
CVE-2013-2251Critical9.8100%KEVFix
CVE-2023-22527Critical9.8100%KEV + RansomFix
CVE-2019-2725Critical9.8100%KEV + RansomFix
CVE-2022-46169Critical9.8100%KEVFix
CVE-2022-35914Critical9.8100%KEV-
CVE-2019-17558High7.599%KEVFix
Embed a live status badge for CVE-2022-31180
CVE-2022-31180 severity badge

Markdown

[![CVE-2022-31180](https://tridentstack.com/cve/badge/CVE-2022-31180.svg)](https://tridentstack.com/cve/CVE-2022-31180)

HTML

<a href="https://tridentstack.com/cve/CVE-2022-31180"><img src="https://tridentstack.com/cve/badge/CVE-2022-31180.svg" alt="CVE-2022-31180"></a>

Find and fix vulnerabilities across your fleet

TridentStack Control continuously scans your Windows, macOS, and Linux fleet for known vulnerabilities, prioritizes them by severity and active exploitation, and patches them automatically.

Start free

This product uses NVD data but is not endorsed or certified by the NVD. EPSS scores courtesy of FIRST.org (https://www.first.org/epss). Source: CISA KEV Catalog. Data as of 2024-11-21.