Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Shescape: Home-directory disclosure in assignment context on Unix with Dash

0
Medium
Published: 07/24/2026 (07/24/2026, 22:34:39 UTC)
Source: GCVE Database
Product: shescape

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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
Low
Vuln. Integrity
Low
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Affected software

npmghsa
shescape
Affected versions
<2.1.14
npmghsa
shescape
Affected versions
>=3.0.0 <3.0.1

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

AILast updated: 07/25/2026, 23:49:45 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses