{"id":"CVE-2026-73411","aliases":["CVE-2026-73411","GHSA-q53c-4prm-w95q"],"related":[],"kind":"vulnerability","state":"published","title":"Shescape: Home-directory disclosure in assignment context on Unix with Dash","summary":"Shescape is a simple shell escape library for JavaScript. Prior to 2.1.14 and 3.0.1, getEscapeFunction in src/internal/unix/dash.js fails to escape ~ after : or = when applications use the escape or escapeAll APIs on Unix with shell set to dash, or with shell set to true when Dash is the default, and interpolate the result into an assignment prefixed to a command. An attacker who controls the input can supply a value such as :~ to disclose the home-directory path and may change the location on which the command operates. This issue is fixed in versions 2.1.14 and 3.0.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Shescape is a simple shell escape library for JavaScript. Prior to 2.1.14 and 3.0.1, getEscapeFunction in src/internal/unix/dash.js fails to escape ~ after : or = when applications use the escape or escapeAll APIs on Unix with shell set to dash, or with shell set to true when Dash is the default, and interpolate the result into an assignment prefixed to a command. An attacker who controls the input can supply a value such as :~ to disclose the home-directory path and may change the location on which the command operates. This issue is fixed in versions 2.1.14 and 3.0.1.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nThis impacts users of Shescape on Unix systems that explicitly configure `shell` to Dash, or `true` when the default shell is Dash, using the `escape` and `escapeAll` APIs in assignments prefixed to a command.\n\nAn attacker may be able to obtain the location of the home directory and, depending on how it is used, change the location on which a command operates in unexpected ways.\n\n```javascript\nimport * as cp from \"node:child_process\";\nimport { Shescape } from \"shescape\";\n\n// 1. Prerequisites\nconst options = {\n    shell: \"dash\",\n    // Or\n    shell: true, // Only if the default shell is Dash\n};\n\n// 2. Payload\nconst payload = \":~\";\n\n// 3. Usage\nconst shescape = new Shescape(options);\nlet escapedPayload;\n\nescapedPayload = shescape.escape(payload);\n// Or\nescapedPayload = shescape.escapeAll([payload]);\n\n// And (example)\nconst result = cp.execSync(`V=${escapedPayload}; echo $V`, options);\n\n// 4. Impact\nconsole.log(result.toString());\n// Outputs \":\" followed by the user's home directory\n```\n\n### Patches\n\nThis bug has been patched in [v2.1.14] and [v3.0.1] which you can upgrade to now.\n\nIf you are already using v3 of Shescape, no further changes are required. If you are using v2 of Shescape it is recommended to upgrade as this version reaches end-of-life status on 2026-09-28, follow the [migration guide] to upgrade to v3.\n\nNo patches will be released for version of Shescape lower than v2.0.0.\n\n### Workarounds\n\nAlternatively, users of Shescape can 1) refrain from using Dash, 2) use the `env` option of the `node:child_process` API to inject variables with untrusted values instead, or 3) remove all instances of `~` from untrusted inputs.\n\n### For more information\n\n- Comment on Pull Request [#2651] for v2 and [#2649] for v3\n- Comment on commit [b4b34c3] for v2 and [43d70b5] for v3\n- Open an issue at <https://github.com/ericcornelissen/shescape/issues> (New issue > Question)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Shescape es una simple biblioteca de escape de shell para JavaScript. Antes de las versiones 2.1.14 y 3.0.1, getEscapeFunction en src/internal/unix/dash.js no logra escapar ~ después de : o = cuyo las aplicaciones usan las API escape o escapeAll en Unix con el shell configurado como dash, o con el shell configurado como true cuyo Dash es el predeterminado, e interpolan el resultado en una asignación prefijada a un comyo. Un atacante que controla la entrada puede proporcionar un valor como :~ para revelar la ruta del directorio de inicio y puede cambiar la ubicación en la que opera el comyo. Este problema está solucionado en las versiones 2.1.14 y 3.0.1.","source":"nvd"}],"published":"2026-07-24T22:34:39.000Z","modified":"2026-10-24T15:10:00.190Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"}],"cwes":["CWE-116","CWE-200"],"affected":[{"ranges":[{"version":"< 2.1.14","status":"affected"},{"version":">= 3.0.0, < 3.0.1","status":"affected"}],"vendor":"ericcornelissen","product":"shescape","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.14"}],"ecosystem":"npm","package":"shescape","purl":"pkg:npm/shescape","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"3.0.0","status":"affected","fixed":"3.0.1"}],"ecosystem":"npm","package":"shescape","purl":"pkg:npm/shescape","source":"ghsa"}],"references":[{"url":"https://github.com/ericcornelissen/shescape/security/advisories/GHSA-q53c-4prm-w95q","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ericcornelissen/shescape/pull/2649","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ericcornelissen/shescape/pull/2651","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ericcornelissen/shescape/commit/43d70b59d09bbe5c3fd02ef08b3a123e977ed9de","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ericcornelissen/shescape/commit/b4b34c394e7f9da2775bb75381066b9a228c425f","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ericcornelissen/shescape/releases/tag/v2.1.14","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ericcornelissen/shescape/releases/tag/v3.0.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ericcornelissen/shescape","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/ericcornelissen/shescape/blob/dea8893a5877893d8d4923dbf253080e08899e6d/docs/migration.md","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-08-12T20:36:06.283Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-73411","url":"https://www.cve.org/CVERecord?id=CVE-2026-73411","licence":"CVE Terms of Use","modified":"2026-08-12T20:54:38.353Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-q53c-4prm-w95q","url":"https://github.com/advisories/GHSA-q53c-4prm-w95q","licence":"CC-BY-4.0","modified":"2026-08-12T19:59:13.666Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-73411","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-73411","licence":"Public domain","modified":"2026-10-24T15:10:00.190Z"}],"updatedAt":"2026-11-25T22:59:32.646Z","epss":{"score":0.00336,"percentile":0.28878,"date":"2026-12-01T12:00:22.000Z"}}