/

CVE-2026-50178

Severity:

HIGH RISK

(8.8)

Markdown Injection (CWE-79) in Angular VS Code Ext

CVE-2026-50178

Analyzed

Vulnerability type

Category:

Markdown / HTML Injection

CWE:

CWE-79, CWE-94

Impact:

Arbitrary Command Execution on Developer Host

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

The Angular Language Service VS Code extension improperly treats hover tooltip Markdown as trusted, enabling active command URIs inside JSDoc comments.

When a developer hovers over a crafted symbol and clicks the malicious link, Visual Studio Code may execute arbitrary commands on the local machine, making untrusted project or dependency code risky.

Affected context

This vulnerability occurs in development environments using the Angular Language Service extension where:

  • Hover tooltips render Markdown content originating from JSDoc comments in project or dependency code
  • The client-side extension configures the Markdown renderer with isTrusted: true
  • The language server forwards Markdown derived from source comments without sanitizing brackets, raw links, or control characters

It is most relevant when developers work with untrusted or partially trusted TypeScript/JavaScript codebases or third‑party npm dependencies.

Exploit preconditions

  • Attack surface: VS Code hover tooltips within the Angular Language Service extension
  • Required access: Ability to introduce or modify TypeScript/JavaScript files or npm package code used in the workspace (e.g., via malicious dependency, cloned project, or insider edits)
  • Trigger point: Developer hovers over a targeted symbol so that its JSDoc tooltip renders, then clicks an embedded command: URI link in the hover Markdown
  • Why exploitation is possible: The client configures the Markdown renderer as trusted (isTrusted: true), and the server does not sanitize or escape potentially dangerous Markdown elements, allowing command URIs and control constructs to pass through unmodified.

Why this happens

The core issue is a trust boundary violation between untrusted documentation content and a privileged Markdown renderer. JSDoc comments from source files are treated as data but are forwarded by the language server into a Markdown rendering path that has been explicitly marked as trusted. This maps to CWE-79 (Improper Neutralization of Input During Web Page Generation), as Markdown is rendered in an environment supporting active elements, and also relates to CWE-94 (Code Injection) because command URIs effectively inject executable command sequences into the IDE. The insecure pattern is combining user-controlled, unsanitized Markdown with a renderer configured to allow active commands.

Potential impact

  • Developer may execute arbitrary command sequences on their host machine by clicking a malicious tooltip link
  • Attackers could run scripts that modify project files, leak credentials, or alter local configuration
  • Local environment compromise, including access to SSH keys, API tokens, or other sensitive development artifacts
  • Potential lateral movement into other systems reachable from the developer workstation

General mitigation guidance

Mitigation typically focuses on tightening the trust boundary around rendered documentation and reducing the privilege of interactive content:

  • Avoid configuring Markdown or HTML renderers as globally trusted; restrict active elements such as command URIs by default
  • Sanitize and escape JSDoc and other documentation strings before converting them into Markdown, removing or neutralizing links, control characters, and embedded commands
  • Apply strict whitelisting for allowable Markdown constructs in tooltips, blocking command schemes and other executable elements
  • Run development tools and extensions under least-privilege principles, so that even if a command executes, its ability to affect the system is constrained
  • Educate developers to treat hover tooltips and in-editor links from untrusted codebases with caution and avoid clicking unexpected command links

How teams detect issues like this

High-level detection approaches include:

  • Static analysis or linting rules that flag use of isTrusted: true or similar constructs in UI renderers handling user-controlled content
  • Code review checklists that call out any paths where documentation, comments, or source code are transformed into trusted Markdown or HTML
  • Policy enforcement in extension or plugin development to require sanitization libraries and explicit escaping for hover, completion, and inline help content
  • Automated scanning of language server and IDE extensions to identify untrusted input flowing into command-capable rendering pipelines

Sources

SourceLink
github.comgithub.com/angular/angular/security/advisories/GHSA-q94j-3wj3-4xcm

Frequently asked

questions

It can be exploited when a developer opens and interacts with a malicious or compromised project or dependency. The attacker typically delivers the payload through source files or npm packages; the actual command execution occurs locally when the developer clicks the malicious tooltip link.

An attacker must be able to introduce or modify TypeScript/JavaScript files or documentation within the workspace, for example by publishing a malicious dependency, compromising a repository, or convincing a developer to open a crafted project.

The safest pattern is to treat hover documentation as untrusted input: sanitize and escape all Markdown derived from comments before rendering, and avoid marking the renderer as trusted or allowing command URIs, especially for content originating from user-controlled code.

Establish secure-by-default guidelines for IDE and language server extensions: never mix untrusted text with a trusted rendering context, enforce sanitization for all documentation paths, restrict active elements in tooltips and inline help, and integrate static analysis and code review policies that explicitly examine trust boundaries around rendered content.

Find out what's already
exploitable in your codebase.