Angular VS Code extension flaw enabled zero-click code execution from malicious workspaces
Vulnerability Disclosure · 4 sources · Updated 5mo ago · First seen Jun 22, 2026

Angular disclosed a high-severity arbitrary code execution flaw in the VS Code Angular Language Service extension (Angular.ng-template) that allowed a malicious repository to run code on a developer’s machine when the folder was opened in VS Code. The issue, tracked as CVE-2026-49241, affected versions prior to 21.2.4 and stemmed from the extension reading a workspace-configured typescript.tsdk path from .vscode/settings.json without honoring VS Code Workspace Trust or requiring user approval. That path was then passed to the background Node.js language server, which loaded tsserverlibrary.js from an attacker-controlled location, creating a zero-click path to host compromise and effectively bypassing VS Code Restricted Mode.
Angular fixed the vulnerability in version 21.2.4 through two hardening changes: blocking workspace-level TypeScript SDK loading in untrusted workspaces and requiring explicit confirmation before loading a workspace-level SDK in trusted ones, with approval stored locally in secure workspace state. A second change disables the language server and related command registration until workspace trust is granted, preventing silent execution in restricted environments. The vulnerability was reported by CodeMender from Google DeepMind and is listed with a CVSS 4.0 score of 8.7 as remotely exploitable.


