v0.7.0
Upgrade recommended for all users. 0.6.1 and earlier let a crafted query prompt execute arbitrary commands.
What's new
Security
- Caller-supplied values can no longer inject CLI flags - the prompt is passed after a
--separator, and the session id, model and effort bind with the=form. Previously aquerywhose prompt was a--settings=payload carrying aSessionStarthook ran an arbitrary command in the caller-suppliedworkingDirectory, with the CLI reporting an input error only after the hook had already fired. - Subprocesses are restricted to a read-only toolset - every spawn passes
--tools, so the defaults withholdBash,WriteandEditon every path.queryandstructuredgetRead Glob Grep,searchgetsWebSearch WebFetch. Previouslyqueryandstructuredpassed no restriction at all, and--allowed-tools(used bysearchand image-query) only grants permission without restricting the toolset. - Tool names are validated as identifiers - a dash-prefixed entry would otherwise terminate the variadic
--toolslist and be parsed as a flag.
Added
CLAUDE_QUERY_TOOLS,CLAUDE_STRUCTURED_TOOLSandCLAUDE_SEARCH_TOOLSto override the built-in toolset per tool. Accepts a comma or space separated list,defaultfor the CLI's full set, or an empty value for no tools.
Fixed
SECURITY.mdclaimedqueryin--baremode had "no tool access by default". Verified false against CLI 2.1.220:--bareand--setting-sources ""bound what context the subprocess loads and never restricted its tools. The docs now describe the real mechanism and add an Argument Injection section.
Changed
spawnClauderejects argv unless--toolsappears before any--separator and carries a value, enforcing the restriction at the subprocess boundary rather than trusting callers.buildClaudeArgstakes a requiredtoolsarray in place of the optionalallowedTools.@modelcontextprotocol/sdk1.30.0,vitest3.2.7 (clears GHSA-5xrq-8626-4rwp).
Upgrading
Subprocesses no longer get the CLI's full toolset. If you relied on query reaching for Bash, Write or Edit, set the matching CLAUDE_*_TOOLS env var to widen the default.
Full Changelog: v0.6.1...v0.7.0