Summary
The Coder VS Code extension allows a repository to supply workspace settings that override security-sensitive extension settings. When a victim with the extension installed opens a malicious workspace, attacker-controlled commands may run with the victim's privileges, and other settings may alter CLI, SSH, TLS, or credential behavior.
Affected context
The issue occurs in the Coder VS Code extension when workspace or folder settings from a repository can override settings that should be controlled by the extension or user. It can affect untrusted workspaces if the extension consumes those settings despite declaring support for untrusted-workspace operation. Sensitive settings include command hooks, CLI paths and arguments, download sources, TLS material and verification, and identity or credential-storage behavior.
Exploit preconditions
- Attack surface: VS Code workspace or folder settings processed by the Coder extension
- Required access: The attacker must be able to provide a repository containing attacker-controlled
.vscode/settings.json; the victim must have the extension installed - Trigger point: The victim opens the malicious workspace and the extension activates or uses the affected settings
- Why exploitation is possible: Workspace-controlled values can override security-sensitive settings, including values later used as shell commands
Why this happens
The extension allows lower-trust workspace and folder configuration to control settings with security-sensitive effects. This maps primarily to CWE-15: External Control of System or Configuration Setting. When attacker-controlled settings are passed to a shell command, the behavior can also result in CWE-78: Improper Neutralization of Special Elements used in an OS Command. Supporting untrusted workspaces without isolating or rejecting these settings leaves the trust boundary unenforced.
Potential impact
- Attacker-controlled commands may execute with the victim user's privileges
- The Coder CLI or its download source could be redirected or supplied with unintended flags
- SSH behavior, TLS verification, or TLS material could be altered
- Identity or credential-storage behavior could be changed, potentially exposing or misusing credentials
General mitigation guidance
Mitigations generally focus on preventing workspace-controlled input from governing privileged extension behavior.
Common defensive patterns include:
- Keep command execution, executable paths, download sources, and credential settings at trusted user or administrator scope
- Reject or ignore workspace-level overrides for security-sensitive settings
- Treat repository configuration as untrusted, including in untrusted-workspace mode
- Use fixed, validated command arguments and avoid shell interpretation where possible
- Apply least privilege to extension-launched processes and limit access to credentials
- Use secure defaults for TLS verification and identity handling
How teams detect issues like this
High-level checks can look for:
- Extension code that reads workspace or folder settings for command, executable, download, TLS, SSH, or credential controls
- Shell execution paths that consume configuration values without strict validation or safe argument handling
- Policy or static-analysis rules that flag security-sensitive settings as workspace-overridable
- Tests verifying that untrusted workspaces cannot change privileged extension behavior
Automated code review tools may help identify configuration trust-boundary issues and command execution sinks.

