Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-49241

CVE-2026-49241: Angular Language Service VS Code RCE Flaw

CVE-2026-49241 is a remote code execution vulnerability in Angular Language Service VS Code Extension. Attackers can execute malicious code by exploiting TypeScript SDK path settings. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2026-49241 Overview

CVE-2026-49241 affects the Angular Language Service VS Code Extension, which provides editing support for Angular templates. Versions prior to 21.2.4 read the custom TypeScript SDK paths typescript.tsdk and js/ts.tsdk.path directly from workspace configurations without verifying VS Code Workspace Trust state or requesting user consent. An attacker can publish a repository containing a malicious tsserverlibrary.js script and a crafted .vscode/settings.json file. When a developer opens the repository in VS Code, the extension automatically loads and executes the attacker-controlled script in the background. The issue is fixed in version 21.2.4.

Critical Impact

Opening an untrusted repository in VS Code with the vulnerable Angular Language Service extension installed results in silent arbitrary code execution on the developer workstation.

Affected Products

  • Angular Language Service VS Code Extension prior to 21.2.4
  • Workspaces containing .vscode/settings.json with custom typescript.tsdk or js/ts.tsdk.path values
  • VS Code installations with the Angular Language Service extension enabled

Discovery Timeline

  • 2026-06-22 - CVE-2026-49241 published to NVD
  • 2026-06-23 - Last updated in NVD database

Technical Details for CVE-2026-49241

Vulnerability Analysis

The vulnerability is an arbitrary code execution flaw classified under [CWE-79]. The client-side extension, located in client/src/client.ts, reads workspace configuration values for typescript.tsdk and js/ts.tsdk.path without consulting VS Code Workspace Trust. The extension forwards the resolved path as a --tsdk command-line argument to the background Node.js language server. During initialization, the language server calls Node.js require() to dynamically import tsserverlibrary.js from the workspace-controlled directory. Because the path originates from untrusted workspace data, an attacker controls which module the server loads.

Root Cause

The extension trusts workspace-scoped settings without gating them behind Workspace Trust or explicit user consent. Custom SDK paths effectively become a remote module loading primitive when sourced from .vscode/settings.json in a repository the developer did not author.

Attack Vector

An attacker commits a repository containing a malicious tsserverlibrary.js inside an attacker-chosen folder and a .vscode/settings.json file with typescript.tsdk or js/ts.tsdk.path pointing to that folder. When a developer clones and opens the repository, the Angular Language Service extension starts the language server with the attacker-supplied --tsdk value. The server then require()s the malicious script, executing arbitrary JavaScript with the developer's privileges. No prompt or warning is displayed, and execution occurs silently in a background Node.js process.

No verified proof-of-concept code is published. Refer to the GitHub Security Advisory GHSA-ccq4-xmxr-8hcq for upstream technical details.

Detection Methods for CVE-2026-49241

Indicators of Compromise

  • Repositories containing a .vscode/settings.json file that sets typescript.tsdk or js/ts.tsdk.path to a relative workspace path.
  • Presence of a tsserverlibrary.js file in a non-standard, workspace-local directory referenced by these settings.
  • Unexpected outbound network connections originating from Node.js child processes spawned by VS Code shortly after opening a repository.

Detection Strategies

  • Scan source control for .vscode/settings.json files containing typescript.tsdk or js/ts.tsdk.path overrides and review the referenced paths.
  • Inspect developer endpoints for Angular Language Service extension versions older than 21.2.4.
  • Hunt for Node.js processes launched by VS Code with a --tsdk argument referencing repository-local directories.

Monitoring Recommendations

  • Monitor child process creation under VS Code (Code.exe, code) for Node.js executions with workspace-relative --tsdk arguments.
  • Alert on file writes to tsserverlibrary.js within repository directories that are not official TypeScript installations.
  • Track outbound network connections and file system modifications by language server processes immediately after repository open events.

How to Mitigate CVE-2026-49241

Immediate Actions Required

  • Upgrade the Angular Language Service VS Code Extension to version 21.2.4 or later.
  • Enable VS Code Workspace Trust and open unfamiliar repositories in Restricted Mode by default.
  • Audit existing repositories for malicious .vscode/settings.json entries that override TypeScript SDK paths.

Patch Information

The vulnerability is fixed in Angular Language Service VS Code Extension version 21.2.4. The upstream fixes are tracked in GitHub Pull Request #68857 and GitHub Pull Request #68886, and disclosed in GitHub Security Advisory GHSA-ccq4-xmxr-8hcq.

Workarounds

  • Disable the Angular Language Service extension until the patched version is installed.
  • Never open untrusted repositories outside of VS Code Workspace Trust Restricted Mode.
  • Strip typescript.tsdk and js/ts.tsdk.path entries from .vscode/settings.json in cloned repositories before opening them.
bash
# Configuration example
# Verify the installed Angular Language Service extension version
code --list-extensions --show-versions | grep Angular.ng-template

# Upgrade to the patched release
code --install-extension Angular.ng-template@21.2.4 --force

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.