CVE-2022-31179 json
Insufficient escaping of line feeds for CMD in shescape
published 2022-07-15 4 y ago modified 2026-06-17 4 mo ago also GHSA-jjc5-fp7p-6f8w , EUVD-2022-6363
- cvss
- 8.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.4%
- EPSS 1.4% chance of exploitation in 30 days, percentile 73%
- public exploits
- 0
- none known
Summary
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).
Patch / fix
- npm shescape 1.5.8
- shescape_project shescape 1.5.8
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- partial
- Assessed
- 18 mo ago
Exploit prediction
1.42% chance of exploitation in the next 30 days, higher than 73% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/ericcornelissen/shescape/security/advisories/GHSA-jjc5-fp7p-6f8w referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:H |
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | shescape | <1.5.8 |
1.5.8 |
Affected products
- ericcornelissen shescape
Classification
- Weakness
-
- CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component
References
-
github.com
/ericcornelissen/shescape/pull/332
web, patch, third-party-advisory
-
github.com
/ericcornelissen/shescape/security/advisories/GHSA-jjc5-fp7p-6f8w
web, exploit, patch, third-party-advisory
-
github.com
/ericcornelissen/shescape/commit/aceea7358f7222984e21260381ebc5ec4543b76f
web
-
github.com
/ericcornelissen/shescape/releases/tag/v1.5.8
web, release-notes, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2022-31179
advisory
-
github.com
/ericcornelissen/shescape
package
Sources
- CVE List CVE-2022-31179
- GitHub Advisory GHSA-jjc5-fp7p-6f8w
- NVD CVE-2022-31179
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.