Improper Encoding or Escaping of Output Affecting shescape package, versions <2.1.14>=3.0.0 <3.0.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-SHESCAPE-18319527
  • published26 Jul 2026
  • disclosed24 Jul 2026
  • creditUnknown

Introduced: 24 Jul 2026

New CVE NOT AVAILABLE CWE-116  (opens in a new tab)

How to fix?

Upgrade shescape to version 2.1.14, 3.0.1 or higher.

Overview

shescape is a simple shell escape library

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output in the escape or escapeAll process when used with the shell option set to Dash or when the default shell is Dash. An attacker can obtain the user's home directory and potentially influence the location on which a command operates by supplying specially crafted input containing ~ characters. This is only exploitable if the application explicitly configures the shell option to Dash or relies on Dash as the default shell in assignment contexts.

Workaround

This vulnerability can be mitigated by refraining from using Dash, using the env option of the node:child_process API to inject variables with untrusted values, or removing all instances of ~ from untrusted inputs.

CVSS Base Scores

version 4.0
version 3.1