OSV 1.4.0 · github-reviewed · 修改于 2026-06-09 07:54
发布时间
2026-05-13 23:31
GitHub 审查时间
2026-05-13 23:31
NVD 发布时间
2026-05-28 05:16
源文件
advisories/github-reviewed/2026/05/GHSA-g3xq-3gmv-qq8g/GHSA-g3xq-3gmv-qq8g.json
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.
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.
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.
'''+payload+''' lands on disk via any normal vector — git clone, archive extraction, npm package, downloaded zip, etc.tools/quota-statusline.sh wired into their CC statusLine config.cds anywhere a hostile path is reachable.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.
input=$(cat)
result=$(python3 -c "
stdin_data = json.loads('''$input''') if '''$input''' else {}
")
Capture stdin in bash, export to env, and pipe the Python source through a single-quoted heredoc (). Single-quoting disables ALL bash interpolation inside the body. Python reads the JSON via , where the bytes are inert at every layer.
<<'PYEOF'os.environ.get('CC_INPUT')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
Until upgrading to v3.5.2:
statusLine entry from ~/.claude/settings.json, ortools/quota-statusline.sh with a script that does NOT pass stdin through python3 -c "..." (a heredoc + env var rewrite is safe)Reported by Jakob Linke (@schuay) via GitHub issue #108.