# CVE-2026-30916: Shescape shell misidentification via symlink chains

Source: https://junglewise.ai/threats/cve-2026-30916-shescape-shell-misidentification-via-symlink-chains  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-03-07. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-30916 · Severity: medium · CVSS 4 · Published 2026-03-07

Shescape is a Node.js library that escapes user input to prevent command injection attacks. A flaw in its shell detection logic could cause it to misidentify the shell type when the shell path points to a symlink chain, potentially allowing an attacker to bypass input escaping and execute unintended commands or expose sensitive data.

Technologies: [shescape (npm)](https://junglewise.ai/threats/technologies/shescape). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-30916 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-30916 being exploited in the wild.

**How severe is CVE-2026-30916?** Medium severity, with a CVSS score of 4, published 7 March 2026.

**Which products and versions are affected?** shescape (npm) SEMVER:introduced=0,fixed=2.1.9.

**Is there a fix for CVE-2026-30916?** Yes. shescape (npm): upgrade to 2.1.9 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-30916 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-30916?** Check whether you run shescape (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- shescape (npm): upgrade to 2.1.9 or later

  ```sh
  npm install shescape@2.1.9
  ```


## Technical details

This vulnerability stems from inadequate symlink resolution in Shescape's shell identification logic. When a shell executable path is configured as a symlink to another symlink (a chain), the library fails to correctly identify the actual shell type, leading to incorrect escaping rules being applied. An attacker who can influence the shell configuration (via symlink chains they control) can cause the library to apply escaping rules for the wrong shell, enabling command injection. The vulnerability requires specific system configuration (shell path pointing to a symlink chain) and affects versions prior to 2.1.9. A patch is available in v2.1.9 which properly resolves symlink chains.

## Affected products

- ericcornelissen shescape prior to 2.1.9

## Identifiers

- CVE-2026-30916
- GHSA-6f6w-6j58-rq76

## Timeline

- 2026-03-07: disclosed
- 2026-03-20: patched: v2.1.9 released with fix

## References

- [https://github.com/ericcornelissen/shescape/security/advisories/GHSA-6f6w-6j58-rq76](https://github.com/ericcornelissen/shescape/security/advisories/GHSA-6f6w-6j58-rq76)

## Related threats

- [Shescape shell injection via unescaped parentheses on Windows CMD](https://junglewise.ai/threats/cve-2026-73414-shescape-shell-injection-via-unescaped-parentheses-on-windows-cmd)
- [Shescape quadratic-time denial of service in flag-protection](https://junglewise.ai/threats/cve-2026-73413-shescape-quadratic-time-denial-of-service-in-flag-protection)
- [Shescape path disclosure on Unix with Zsh](https://junglewise.ai/threats/cve-2026-73412-shescape-path-disclosure-on-unix-with-zsh)
- [Shescape home-directory disclosure in Dash shell assignment](https://junglewise.ai/threats/cve-2026-73411-shescape-home-directory-disclosure-in-dash-shell-assignment)
- [Shescape escape() bracket glob expansion bypass on Bash, BusyBox, and Dash](https://junglewise.ai/threats/cve-2026-32094-shescape-escape-bracket-glob-expansion-bypass-on-bash-busybox-and)
