CVE-2022-31179
CWE-74Published: August 1, 2022· Updated: Jun 17, 2026
Official Description
Shescape is a simple shell escape package for JavaScript. Versions prior to 1.5.8 were found to be subject to code injection on windows. This impacts users that use Shescape (any API function) to escape arguments for cmd.exe on Windows An attacker can omit all arguments following their input by including a line feed character (`'\n'`) in the payload. This bug has been patched in [v1.5.8] which you can upgrade to now. No further changes are required. Alternatively, line feed characters (`'\n'`) can be stripped out manually or the user input can be made the last argument (this only limits the impact).
Risk Analysis
Shescape versions prior to 1.5.8 are vulnerable to code injection on Windows when escaping arguments for cmd.exe. This critical flaw, rated 9.8, allows attackers to terminate command strings prematurely using line feed characters. It is not in the CISA KEV.
There is no known public exploit for this vulnerability. It is remotely exploitable.
Upgrade to Shescape version 1.5.8 or later. Alternatively, manually strip line feed characters from user input.
Technical Analysis
CVE-2022-31179 can be exploited remotely over the network without requiring physical or adjacent access, significantly expanding the attack surface for threat actors.
The vulnerability requires no privileges and no user interaction, making it a prime target for automated exploitation campaigns and worm-like propagation.
A successful exploit results in complete confidentiality breach (data exposure), full integrity compromise (data manipulation), availability disruption (denial of service), with a CVSS base score of 9.8.
CVSS v3.1 Vector Breakdown
Affected Vendors & Products
Exploit & PoC Resources
Official Patches & Advisories
All References (6)
Quick Facts
Related CVEs (CWE-74)
Recommended Actions
- →Apply vendor patches immediately
- →Monitor CVE-2022-31179 in threat intel feeds
- →Review IDS/IPS signatures for exploitation attempts