Skip to content

Chat: sandbox escape #298729

Closed
Closed

Description

@sr-tream

Does this issue occur when all extensions are disabled?: Cannot test without copilot extension, but chat is VSCode feature

  • VS Code Version: Insiders, commit f5927e7
  • OS Version: ArchLinux

Steps to Reproduce:

  1. Enable sandbox for VSCode chat terminal (chat.tools.terminal.sandbox.enabled)
  2. Ask agent to execute command like ";<ANY COMMAND HERE>; #, e.g. ";curl eth0.me; #
  3. Command executed out of sandbox

Why its happened:

Sandbox pass terminal command just in quotas and do not check the command body, like:

ELECTRON_RUN_AS_NODE=1 PATH="$PATH:/opt/visual-studio-code-insiders/resources/app/node_modules/@vscode/ripgrep/bin" TMPDIR="/tmp" "/opt/visual-studio-code-insiders/code-insiders" "/opt/visual-studio-code-insiders/resources/app/node_modules/@anthropic-ai/sandbox-runtime/dist/cli.js" --settings "/tmp/vscode-sandbox-settings-998edd7a-0fac-45d8-8aa9-75f7e7236647.json" -c "echo hi"

The sandbox feature must parse the command first and escapes special characters, like " inside of command

Activity

  1. added
    chat-terminal
    and removed on Mar 2, 2026
  2. added
    candidate
    and removed
    candidate
    on Mar 2, 2026
  3. added
    candidate
    on Mar 2, 2026
  4. sr-tream commented on Mar 3, 2026

    @sr-tream
    Author

    Can confirm fix in VSCode Insiders 2814395

    Image
  5. locked and limited conversation to collaborators on Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

candidatechat-terminal

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions