CVE-2022-31180

CriticalCVSS 9.8/10Last modified Jun 17, 2026

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](https://github.com/ericcornelissen/shescape#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.

Metrics

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

Weakness enumeration

Affected software

No affected versions have been published.

Timeline

Published
Aug 1, 2022
Last modified
Jun 17, 2026
NVD status
Modified

Related CVEs from 2022

CVE-2022-311819.8PrestaShop is an Open Source e-commerce platform. In versions from 1.6.0.10 and before 1.7.8.7 PrestaShop is subject to an SQL injection vulCVE-2022-311825.3Discourse is the an open source discussion platform. In affected versions a maliciously crafted request for static assets could cause error CVE-2022-311839.8fs2 is a compositional, streaming I/O library for Scala. When establishing a server-mode `TLSSocket` using `fs2-io` on Node.js, the parameteCVE-2022-311847.5Discourse is the an open source discussion platform. In affected versions an email activation route can be abused to send mass spam emails. CVE-2022-311855.3mprweb is a hosting platform for the makedeb Package Repository. Email addresses were found to not have been hidden, even if a user had clicCVE-2022-311863.3NextAuth.js is a complete open source authentication solution for Next.js applications. An information disclosure vulnerability in `next-autCVE-2022-311875.4GLPI stands for Gestionnaire Libre de Parc Informatique and is a Free Asset and IT Management Software package, that provides ITIL Service DCVE-2022-311889.8CVAT is an opensource interactive video and image annotation tool for computer vision. Versions prior to 2.0.0 were found to be subject to aCVE-2022-311895.3DSpace open source software is a repository application which provides durable access to digital resources. dspace-jspui is a UI component fCVE-2022-31197.5The OAuth client Single Sign On WordPress plugin before 3.0.4 does not have authorisation and CSRF when updating its settings, which could aCVE-2022-311905.3DSpace open source software is a repository application which provides durable access to digital resources. dspace-xmlui is a UI component fCVE-2022-311916.1DSpace open source software is a repository application which provides durable access to digital resources. dspace-jspui is a UI component f
CVE-2022-31180: Critical severity, CVSS 9.8 | Vulnix