Conversation
LookupDangerousEnv was unconditionally case-insensitive, causing false positives on Unix where eNV ≠ ENV. Now: - Windows: case-insensitive (env vars are case-insensitive on Windows) - Unix: case-sensitive (exact match only) Uses ShellEnvironment().IsWindows() from the existing platform module. Removes the unused dangerousEnvVarsLower lookup table.
Parse "type" actions from computer use tool calls through the shell AST pipeline — catches credential reads, env var poisoning, and reverse shells typed via GUI automation. - extractor.go: add "computer" to Layer 1 tool name switch - extractor_tools.go: extractComputerTool — injects type action text into command field for shell AST parsing; skips screenshot/click/scroll - sse_parser.go: handle OpenAI "computer_call" item type in SSE stream (was only handling "function_call") - proxy_toolcalls.go: same for non-streaming OpenAI responses - cve_test.go: 9 tests (4 blocked type actions + 5 safe actions)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three changes: fix fuzz-discovered env var false positive, add computer use tool interception, and auto-proxy Claude Desktop/Cowork on macOS.
1. Platform-aware env var detection
LookupDangerousEnvwas unconditionally case-insensitive, blockingeNV=on Unix where it differs fromENV. Now case-sensitive on Unix, case-insensitive on Windows. Uses existingShellEnvironment().IsWindows(). Removes unuseddangerousEnvVarsLowerlookup table.2. Computer use tool interception (Claude + OpenAI)
Claude Computer Use and OpenAI CUA send GUI actions as tool calls. The
typeaction types text into the active app — if the agent types a shell command into a terminal, Crust now intercepts it.extractor_tools.go: newextractComputerTool()— extractstypeaction text, parses through shell AST pipelinesse_parser.go: handle OpenAIcomputer_callitem type in SSE streamingproxy_toolcalls.go: same for non-streaming OpenAI responses3. Auto-proxy Claude Desktop/Cowork (macOS)
Claude Desktop (including Cowork) is an Electron app with no proxy config file. On macOS, Crust now sets
HTTPS_PROXY/HTTP_PROXYvialaunchctl setenvwhen the daemon starts, routing all Claude Desktop API calls through Crust's proxy.builtin_darwin.go: new macOS-only registry target/Applications/Claude.applaunchctl unsetenvrestores original statecrust startTest plan
FuzzNormalAgentFalsePositive— 33K executions, zero failures