| Affected_by_vulnerabilities |
| 0 |
|
| 1 |
| url |
VCID-8tmm-r9hx-t7gh |
| vulnerability_id |
VCID-8tmm-r9hx-t7gh |
| summary |
Cleartext Storage of Sensitive Information in an Environment Variable
Shescape is a simple shell escape library for JavaScript. An attacker may be able to get read-only access to environment variables. This bug has been patched in version 1.7.1. |
| references |
|
| fixed_packages |
|
| aliases |
CVE-2023-35931, GHSA-3g7p-8qhx-mc8r
|
| risk_score |
1.4 |
| exploitability |
0.5 |
| weighted_severity |
2.8 |
| resource_url |
http://public2.vulnerablecode.io/vulnerabilities/VCID-8tmm-r9hx-t7gh |
|
| 2 |
| url |
VCID-cy6p-xc3p-wbe1 |
| vulnerability_id |
VCID-cy6p-xc3p-wbe1 |
| summary |
Withdrawn Advisory: Shescape has possible misidentification of shell due to link chains
This impacts users of Shescape that configure their `shell` to point to a file on disk that is a link to a link. The precise result of being affected depends on the actual shell used and incorrect shell identified by Shescape.
In particular, an attacker may be able to bypass escaping for the shell being used. This can result, for example, in exposure of sensitive information, consider the following proof of concept (targeting Shescape v2):
```javascript
import fs from "node:fs";
import { exec } from "node:child_process";
import { Shescape } from "shescape";
import which from "which";
/* 1. Set up */
const shell = which.sync("bash");
const linkToShell = "./csh";
const linkToLink = "./link";
fs.rmSync(linkToLink, { force: true });
fs.rmSync(linkToShell, { force: true });
fs.symlinkSync(shell, linkToShell);
fs.symlinkSync(linkToShell, linkToLink);
/* 2. Misconfiguration */
const execOptions = {
shell: linkToLink,
};
const shescape = new Shescape({
shell: execOptions.shell,
});
/* 3. Payload */
const userInput = "a=:~";
/* 4. Attack example */
exec(
`echo Hello ${shescape.escape(userInput)}`,
{ shell: execOptions.shell },
(error, stdout) => {
fs.rmSync(linkToLink);
fs.rmSync(linkToShell);
if (error) {
console.error(`An error occurred: ${error}`);
} else {
console.log(stdout);
// Output: "Hello a=:/home/user"
}
},
);
``` |
| references |
|
| fixed_packages |
|
| aliases |
CVE-2026-30916, GHSA-6f6w-6j58-rq76
|
| risk_score |
1.4 |
| exploitability |
0.5 |
| weighted_severity |
2.7 |
| resource_url |
http://public2.vulnerablecode.io/vulnerabilities/VCID-cy6p-xc3p-wbe1 |
|
| 3 |
|
| 4 |
| url |
VCID-px7h-1hh9-wuhs |
| vulnerability_id |
VCID-px7h-1hh9-wuhs |
| summary |
Shescape prior to 1.5.8 vulnerable to insufficient escaping of line feeds for CMD
### Impact
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. Example:
```javascript
import cp from "node:child_process";
import * as shescape from "shescape";
// 1. Prerequisites
const options = {
shell: "cmd.exe",
};
// 2. Attack
const payload = "attacker\n";
// 3. Usage
let escapedPayload;
escapedPayload = shescape.escape(payload, options);
// Or
escapedPayload = shescape.escapeAll([payload], options)[0];
// Or
escapedPayload = shescape.quote(payload, options);
// Or
escapedPayload = shescape.quoteAll([payload], options)[0];
cp.execSync(`echo Hello ${escapedPayload}! How are you doing?`, options);
// Outputs: "Hello attacker"
```
> **Note**: `execSync` is just illustrative here, all of `exec`, `execFile`, `execFileSync`, `fork`, `spawn`, and `spawnSync` can be attacked using a line feed character if CMD is the shell being used.
### Patches
This bug has been patched in [v1.5.8] which you can upgrade to now. No further changes are required.
### Workarounds
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).
### References
- https://github.com/ericcornelissen/shescape/pull/332
- https://github.com/ericcornelissen/shescape/releases/tag/v1.5.8
### For more information
If you have any questions or comments about this advisory:
- Comment on https://github.com/ericcornelissen/shescape/pull/332
- Open an issue at https://github.com/ericcornelissen/shescape/issues (_New issue_ > _Question_ > _Get started_)
[v1.5.8]: https://github.com/ericcornelissen/shescape/releases/tag/v1.5.8 |
| references |
| 0 |
| reference_url |
https://api.first.org/data/v1/epss?cve=CVE-2022-31179 |
| reference_id |
|
| reference_type |
|
| scores |
| 0 |
| value |
0.00625 |
| scoring_system |
epss |
| scoring_elements |
0.7059 |
| published_at |
2026-06-07T12:55:00Z |
|
| 1 |
| value |
0.00625 |
| scoring_system |
epss |
| scoring_elements |
0.70608 |
| published_at |
2026-06-06T12:55:00Z |
|
| 2 |
| value |
0.00625 |
| scoring_system |
epss |
| scoring_elements |
0.70598 |
| published_at |
2026-06-05T12:55:00Z |
|
| 3 |
| value |
0.00625 |
| scoring_system |
epss |
| scoring_elements |
0.70556 |
| published_at |
2026-06-04T12:55:00Z |
|
|
| url |
https://api.first.org/data/v1/epss?cve=CVE-2022-31179 |
|
| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
|
| fixed_packages |
|
| aliases |
CVE-2022-31179, GHSA-jjc5-fp7p-6f8w, GMS-2022-3205
|
| risk_score |
4.0 |
| exploitability |
0.5 |
| weighted_severity |
8.0 |
| resource_url |
http://public2.vulnerablecode.io/vulnerabilities/VCID-px7h-1hh9-wuhs |
|
| 5 |
| url |
VCID-wpfp-cjd5-87g2 |
| vulnerability_id |
VCID-wpfp-cjd5-87g2 |
| summary |
Shescape escape() leaves bracket glob expansion active on Bash, BusyBox, and Dash
`Shescape#escape()` does not escape square-bracket glob syntax for Bash, BusyBox `sh`, and Dash. Applications that interpolate the return value directly into a shell command string can cause an attacker-controlled value like `secret[12]` to expand into multiple filesystem matches instead of a single literal argument, turning one argument into multiple trusted-pathname matches. |
| references |
| 0 |
|
| 1 |
| reference_url |
https://github.com/ericcornelissen/shescape |
| reference_id |
|
| reference_type |
|
| scores |
| 0 |
| value |
6.9 |
| scoring_system |
cvssv4 |
| scoring_elements |
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
|
| 1 |
| value |
MODERATE |
| scoring_system |
generic_textual |
| scoring_elements |
|
|
|
| url |
https://github.com/ericcornelissen/shescape |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
|
| fixed_packages |
|
| aliases |
CVE-2026-32094, GHSA-9jfh-9xrq-4vwm
|
| risk_score |
3.1 |
| exploitability |
0.5 |
| weighted_severity |
6.2 |
| resource_url |
http://public2.vulnerablecode.io/vulnerabilities/VCID-wpfp-cjd5-87g2 |
|
| 6 |
| url |
VCID-xw8t-7zmd-gqds |
| vulnerability_id |
VCID-xw8t-7zmd-gqds |
| summary |
Shescape vulnerable to insufficient escaping of whitespace
### Impact
This only impacts users that use the `escape` or `escapeAll` functions with the `interpolation` option set to `true`. Example:
```javascript
import cp from "node:child_process";
import * as shescape from "shescape";
// 1. Prerequisites
const options = {
shell: "bash",
// Or
shell: "dash",
// Or
shell: "powershell.exe",
// Or
shell: "zsh",
// Or
shell: undefined, // Only if the default shell is one of the affected shells.
};
// 2. Attack (one of multiple)
const payload = "foo #bar";
// 3. Usage
let escapedPayload;
shescape.escape(payload, { interpolation: true });
// Or
shescape.escapeAll(payload, { interpolation: true });
cp.execSync(`echo Hello ${escapedPayload}!`, options);
// _Output depends on the shell being used_
```
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.
- Affected shells: _Bash_, _Dash_, _Zsh_, _PowerShell_
2. Invoke shell-specific behaviour through shell-specific special characters inserted or appearing after line terminating characters.
- Affected shells: _Bash_
3. Invoke arbitrary commands by inserting a line feed character.
- Affected Shells: _Bash_, _Dash_, _Zsh_, _PowerShell_
3. Invoke arbitrary commands by inserting a carriage return character.
- Affected Shells: _PowerShell_
### Patches
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.
### Workarounds
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, you can 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.
### References
- https://github.com/ericcornelissen/shescape/pull/322
- https://github.com/ericcornelissen/shescape/pull/324
- https://github.com/ericcornelissen/shescape/pull/332
- https://github.com/ericcornelissen/shescape/releases/tag/v1.5.7
- https://github.com/ericcornelissen/shescape/releases/tag/v1.5.8
### For more information
- Comment on:
- For behaviour 1 (PowerShell): https://github.com/ericcornelissen/shescape/pull/322
- For behaviour 1 (Bash, Dash, Zsh): https://github.com/ericcornelissen/shescape/pull/324
- For behaviour 2, 3, 4 (_any shell_): https://github.com/ericcornelissen/shescape/pull/332
- Open an issue at https://github.com/ericcornelissen/shescape/issues (_New issue_ > _Question_ > _Get started_)
- If you're missing CMD from this advisory, see https://github.com/ericcornelissen/shescape/security/advisories/GHSA-jjc5-fp7p-6f8w
[v1.5.7]: https://github.com/ericcornelissen/shescape/releases/tag/v1.5.7
[v1.5.8]: https://github.com/ericcornelissen/shescape/releases/tag/v1.5.8 |
| references |
| 0 |
| reference_url |
https://api.first.org/data/v1/epss?cve=CVE-2022-31180 |
| reference_id |
|
| reference_type |
|
| scores |
| 0 |
| value |
0.0108 |
| scoring_system |
epss |
| scoring_elements |
0.78188 |
| published_at |
2026-06-04T12:55:00Z |
|
| 1 |
| value |
0.0108 |
| scoring_system |
epss |
| scoring_elements |
0.78211 |
| published_at |
2026-06-07T12:55:00Z |
|
| 2 |
| value |
0.0108 |
| scoring_system |
epss |
| scoring_elements |
0.78221 |
| published_at |
2026-06-06T12:55:00Z |
|
| 3 |
| value |
0.0108 |
| scoring_system |
epss |
| scoring_elements |
0.78214 |
| published_at |
2026-06-05T12:55:00Z |
|
|
| url |
https://api.first.org/data/v1/epss?cve=CVE-2022-31180 |
|
| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
|
| fixed_packages |
|
| aliases |
CVE-2022-31180, GHSA-44vr-rwwj-p88h, GMS-2022-3204
|
| risk_score |
4.5 |
| exploitability |
0.5 |
| weighted_severity |
9.0 |
| resource_url |
http://public2.vulnerablecode.io/vulnerabilities/VCID-xw8t-7zmd-gqds |
|
|