AI and data stack advisories

Severe, 6 weeks1496Projects326

1496 severe, 6 weeks · 326 projects

MicrosoftGHSA-w79w-rj9h-vg4f

Copilot Custom Agent Hook Remote Code Execution Vulnerability

Microsoft

CVE-2026-70335 · Published Aug 11, 2026

High7.8
Fix: upgrade to 1.132.1 or later
GitHub advisory

Impact

A remote code execution vulnerability exists in VS Code 1.132.0 and earlier versions where a crafted prompt injection can cause the Copilot agent to write custom agent files containing lifecycle hooks without presenting a confirmation to the user. When the custom agent is invoked, these hooks can execute attacker-controlled shell commands with the privileges of the user running VS Code.

Patches

The fix is available starting with VS Code 1.132.1. The fix ([4224780](https://github.com/microsoft/vscode/commit/4224780376b700ba06c8f98442abbb971e596a88)) mitigates this attack by requiring confirmation before editing agent and hook configuration files that can register lifecycle shell commands.

Workarounds

Avoid including untrusted data in Copilot prompts. Do not use Copilot Agent mode with untrusted workspaces, files, or instructions on versions of VS Code <=1.132.0.

References

  • The patch for this can be found at [4224780](https://github.com/microsoft/vscode/commit/4224780376b700ba06c8f98442abbb971e596a88)
  • An issue for this can be found at [#330322](https://github.com/microsoft/vscode/issues/330322)
  • MSRC details for this can be found at [https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-70335](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-70335)

Affected versions

PackageAffectedFixed in
vscode
Product
< 1.132.11.132.1
Details and references
CVSS 3.1
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Severity from
GitHub (reviewed advisory)

More Microsoft advisories

All Microsoft