VS Code 1.145.3: agent text could run local commands without approval
CVE-2026-120782 let local-command syntax from an agent message skip terminal approval in VS Code. Who is exposed, the scoring gap and what to change.
Terminal approval is the control most developers rely on when an AI agent works in their editor: the agent can propose a command, but a person decides whether it runs. On 10 November 2026 Microsoft published a fix for a case where that check could be skipped. In VS Code 1.145.2 and earlier, local-command syntax that came from an agent's message could be treated as if the user had typed it, and run without the expected approval. The fix is in VS Code 1.145.3. If your developers use agents in VS Code, the update is the first step; the advisory's workaround also says something about which agent harness you should be on.
What the advisory says
The GitHub security advisory GHSA-w9fm-7vcm-cvq4 describes a security feature bypass in the VS Code Agent Host. Local-command syntax originating from an agent message "could be treated as if it had been entered directly by the user and could execute without the expected terminal approval."
Two conditions have to hold, according to the advisory:
- An attacker has to influence an agent's child prompt, "typically through untrusted repository instructions or other prompt content". In practice that means instruction files, issue text, documentation or tool output the agent reads.
- The user has to have granted the related session tool operation.
The fix, in commit 0b7cb30, preserves where each message came from and only handles local commands in messages that actually originated from the user. All versions before 1.145.3 are listed as affected. The 1.145 release notes show the feature release on 4 November 2026 and 1.145.3 as the update that "addresses these security issues".
Two scores for one bug
The severity depends on where you look, and the difference is worth understanding before you triage.
- The GitHub advisory rates it Moderate, 6.8.
- The Microsoft Security Update Guide entry for CVE-2026-120782 gives the same vector,
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C, but lists a base score of 7.8 and a temporal score of 6.8, with a maximum severity of Important.
So 6.8 is the temporal score, lowered because no exploit code is public (E:U) and an official fix exists (RL:O). The base score of 7.8 falls in the CVSS "high" band. Microsoft classifies the weakness as code injection (CWE-94) and incorrect authorisation (CWE-863), and its exploitability assessment says the issue was not publicly disclosed or exploited when published, with exploitation "less likely". If your vulnerability process keys on base scores, this one is high; if it uses the GitHub label, it reads as moderate. Neither is wrong, but they shouldn't be compared with each other.
Which harness is affected
The advisory's summary names the Agent Host, while its first workaround is to "use the Copilot harness instead of the Local harness where available". In VS Code's own harness documentation, the Copilot harness is the one that runs in the Agent Host, and the Local harness runs in the extension host. The advisory doesn't spell out how the two statements fit together. The safe reading is to treat every harness on 1.145.2 or earlier as needing the update, and to read the workaround as Microsoft's view that the Copilot harness is the safer place to run agents meanwhile.
That view matches the rest of the documentation. The Local harness is deprecated and will be removed by February 2027. The harness guide states that "Local does not enforce runtime-only sandbox and permission rules", while Copilot harness sessions continue to enforce them. Since version 1.142, administrators can set vscode.temporaryDefaultToLocalHarness in enterprise-managed settings to keep Local as the default during migration; the documentation tells administrators to review the security impact before doing so. From version 1.143, vscode.temporaryAllowLocalHarness: false prohibits the Local, Claude and Codex harnesses and overrides that temporary default.
What it means for engineering and security leaders
The bug is a good example of a class that will keep appearing: confusion about who said something. An agent's context mixes the user's words, the model's words and text pulled from files and tools. Controls such as approval prompts only work if the editor knows which is which. Here, text in an agent message could take on the authority of the user. The fix restores that distinction, but the lesson for leaders is broader: approval prompts are a strong control only while the tool tracks message origin correctly, and any session-wide permission removes the prompt anyway.
The second point is about policy. Organisations that kept the Local harness as the default to avoid migration work are running the harness that Microsoft says doesn't enforce runtime-only sandbox and permission rules, and that the advisory steers people away from. The migration guide lists managed sandbox policy among the governance features only the Copilot harness has. If the temporary Local default is still set, this advisory is a good moment to set a date for removing it.
Practical takeaways
- Update VS Code to 1.145.3 or later on every developer machine, paying particular attention to machines where automatic updates are turned off.
- Look for
vscode.temporaryDefaultToLocalHarnessin your enterprise-managed settings. If it is set, plan the move to the Copilot harness rather than waiting for the February 2027 removal. - Keep terminal approvals on, and avoid granting session-wide tool permissions in repositories whose instructions you don't control, as the advisory recommends.
- Treat repository instructions as untrusted input. Agent instruction files, issue bodies and documentation from outside contributors are exactly the "prompt content" the advisory describes.
- Record both scores in your tracker: 7.8 base and 6.8 temporal, so different teams don't triage the same CVE differently.
For context on earlier VS Code agent fixes, see VS Code 1.141.1 and hook file edits, and for the limits of built-in sandboxes, what the built-in sandboxes do and don't cover.
Sources
- GitHub advisory GHSA-w9fm-7vcm-cvq4: Command Execution via Agent-Originated Local Commands (microsoft/vscode, 10 November 2026)
- Microsoft Security Update Guide: CVE-2026-120782, Visual Studio Code Security Feature Bypass Vulnerability
- Visual Studio Code 1.145 release notes (updates 1.145.1 to 1.145.3)
- VS Code documentation: Choose an agent harness
- VS Code documentation: Move from the Local to the Copilot harness