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: trueor 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

