Shescape: Home-directory disclosure in assignment context on Unix with Dash
A vulnerability in the Shescape library on Unix systems using the Dash shell allows an attacker to disclose the user's home directory when using the escape or escapeAll APIs in assignment contexts prefixed to a command. This can lead to unexpected command behavior if the disclosed home directory is used maliciously. The issue affects versions of Shescape prior to v2.1.14 and versions from 3.0.0 up to but not including 3.0.1. Patches are available in v2.1.14 and v3.0.1. Workarounds include avoiding Dash, using environment variables for untrusted inputs, or removing '~' from untrusted inputs.
AI Analysis
Technical Summary
The Shescape library has a vulnerability impacting Unix systems configured to use the Dash shell (explicitly or by default). When using the escape or escapeAll APIs in assignments prefixed to a command, an attacker can cause the shell to reveal the user's home directory by exploiting how the tilde (~) character is expanded in Dash. This disclosure can alter the command's operational context unexpectedly. The vulnerability is patched in Shescape versions v2.1.14 and v3.0.1. Users of earlier versions should upgrade accordingly. No patches are planned for versions below 2.0.0. Alternative mitigations include avoiding Dash or sanitizing inputs.
Potential Impact
An attacker can obtain the location of the user's home directory on Unix systems running Dash shell when Shescape's escape or escapeAll APIs are used in assignment contexts. This information disclosure may lead to commands operating on unintended paths, potentially causing unexpected behavior. The vulnerability does not directly allow code execution or privilege escalation but may facilitate further attacks depending on usage context.
Mitigation Recommendations
A fix is available in Shescape versions v2.1.14 and v3.0.1; upgrading to these versions is recommended. If using version 3, no further action is needed. For version 2 users, upgrading is advised as v2 reaches end-of-life in 2026. Workarounds include avoiding the Dash shell, using the 'env' option in node:child_process to inject untrusted variables instead of using escape APIs, or removing all '~' characters from untrusted inputs. No patches will be released for versions below 2.0.0.
Shescape: Home-directory disclosure in assignment context on Unix with Dash
Description
A vulnerability in the Shescape library on Unix systems using the Dash shell allows an attacker to disclose the user's home directory when using the escape or escapeAll APIs in assignment contexts prefixed to a command. This can lead to unexpected command behavior if the disclosed home directory is used maliciously. The issue affects versions of Shescape prior to v2.1.14 and versions from 3.0.0 up to but not including 3.0.1. Patches are available in v2.1.14 and v3.0.1. Workarounds include avoiding Dash, using environment variables for untrusted inputs, or removing '~' from untrusted inputs.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Shescape library has a vulnerability impacting Unix systems configured to use the Dash shell (explicitly or by default). When using the escape or escapeAll APIs in assignments prefixed to a command, an attacker can cause the shell to reveal the user's home directory by exploiting how the tilde (~) character is expanded in Dash. This disclosure can alter the command's operational context unexpectedly. The vulnerability is patched in Shescape versions v2.1.14 and v3.0.1. Users of earlier versions should upgrade accordingly. No patches are planned for versions below 2.0.0. Alternative mitigations include avoiding Dash or sanitizing inputs.
Potential Impact
An attacker can obtain the location of the user's home directory on Unix systems running Dash shell when Shescape's escape or escapeAll APIs are used in assignment contexts. This information disclosure may lead to commands operating on unintended paths, potentially causing unexpected behavior. The vulnerability does not directly allow code execution or privilege escalation but may facilitate further attacks depending on usage context.
Mitigation Recommendations
A fix is available in Shescape versions v2.1.14 and v3.0.1; upgrading to these versions is recommended. If using version 3, no further action is needed. For version 2 users, upgrading is advised as v2 reaches end-of-life in 2026. Workarounds include avoiding the Dash shell, using the 'env' option in node:child_process to inject untrusted variables instead of using escape APIs, or removing all '~' characters from untrusted inputs. No patches will be released for versions below 2.0.0.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-q53c-4prm-w95q
- Osv Schema Version
- 1.4.0
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 4.0
Threat ID: 6a6542199c2644c7f8087e59
Added to database: 07/25/2026, 23:09:13 UTC
Last enriched: 07/25/2026, 23:49:45 UTC
Last updated: 07/26/2026, 03:44:30 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.