CVE-2022-31179
CRITICAL 9.8CVSS 3.1Shescape prior to 1.5.8 vulnerable to insufficient escaping of line feeds for CMD
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).
- Published
- 1 Aug 2022
- Last modified
- 17 Jun 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Modified
- Weakness
- CWE-74
- Also known as
- GHSA-jjc5-fp7p-6f8w
- Sources
- NVDJSONOSV GHSA-jjc5-fp7p-6f8wJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | HIGH 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | shescape_project | shescapecpe:2.3:a:shescape_project:shescape:*:*:*:*:*:*:*:* |
< 1.5.8 | 1.5.8 |
| OSV | npm | shescape | < 1.5.8 | 1.5.8 |
References
- https://github.com/ericcornelissen/shescape/pull/332 · Patch, Third Party Advisory, WEB
- https://github.com/ericcornelissen/shescape/releases/tag/v1.5.8 · Release Notes, Third Party Advisory, WEB
- https://github.com/ericcornelissen/shescape/security/advisories/GHSA-jjc5-fp7p-6f8w · Exploit, Patch, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2022-31179 · ADVISORY
- https://github.com/ericcornelissen/shescape/commit/aceea7358f7222984e21260381ebc5ec4543b76f · WEB
- https://github.com/ericcornelissen/shescape · PACKAGE
History
- 25 Nov 2026 20:34 UTC · NVD: first stored (published 1 Aug 2022)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 15 Jul 2022)