# CVE-2022-31179: Insufficient escaping of line feeds for CMD in shescape

- Severity: High 8.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.42%, higher than 73% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-07-15T21:39:14.000Z
- Modified: 2026-06-17T04:44:58.233Z
- Also known as: GHSA-jjc5-fp7p-6f8w
- Weaknesses: CWE-74
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## 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).

(As written by CVE List.)

## Affected

- ericcornelissen shescape: < 1.5.8
- shescape (npm): before 1.5.8
- shescape_project shescape: before 1.5.8

## Every score

- GitHub_M: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:H`
- GitHub: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:H`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/ericcornelissen/shescape/security/advisories/GHSA-jjc5-fp7p-6f8w> (exploit, 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/pull/332> (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)

## Sources

- CVE List: [CVE-2022-31179](https://www.cve.org/CVERecord?id=CVE-2022-31179), CVE Terms of Use, modified 2025-04-22
- GitHub Advisory Database: [GHSA-jjc5-fp7p-6f8w](https://github.com/advisories/GHSA-jjc5-fp7p-6f8w), CC-BY-4.0, modified 2023-11-08
- NVD: [CVE-2022-31179](https://nvd.nist.gov/vuln/detail/CVE-2022-31179), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-31179 · Whole record: https://cve.day/CVE-2022-31179.json · Rebuilt by cve.day 2026-11-25T22:58:13.343Z
