Warning signs include extension code that builds Markdown by string interpolation, enables trusted rendering by default, or passes repository data straight into hover cards, issue previews, or webviews. Another red flag is relying on partial sanitisation while still allowing raw Markdown constructs. Those patterns indicate the rendering boundary is too permissive for untrusted workspace content.
What the warning signs actually tell you about the extension boundary
The clearest signs are not visual glitches, they are trust-boundary mistakes. If an extension turns repository text into Markdown without treating the input as hostile, it is effectively giving workspace content a path into UI surfaces that users assume are safe. That matters because hover cards, previews, and webviews often inherit richer rendering behavior than plain text.
A second warning sign is inconsistency. If the extension sanitises some fields but still permits raw Markdown constructs in others, the safety model is probably ad hoc rather than deliberate. That usually means the author is reasoning about what looks harmless instead of enforcing a single rule for all attacker-controlled content.
Extensions become especially suspect when they compose Markdown by string interpolation. That pattern usually means the developer is mixing trusted chrome with untrusted payloads, so a malicious repository can influence links, images, formatting, or embedded content in ways the UI was not meant to expose.
Where the failure usually shows up in VS Code
The most common failure points are the places where text gets promoted into richer rendering contexts: hover providers, issue or diff previews, completion documentation, and webviews. If the extension passes data straight through from the workspace, issue tracker, or remote repository metadata into one of those surfaces, the rendering path is probably too permissive.
Look for code that enables “trusted” rendering by default, or that assumes Markdown from a repository is equivalent to authored documentation. In practice, attacker-controlled Markdown can be used to mislead users, inject unexpected links, or make malicious content look like part of the extension’s own interface. The rendering engine is not the problem by itself, the problem is granting it trust without validating the source.
Partial sanitisation is another strong signal. If an extension removes one risky construct but still allows the rest of the Markdown grammar, the attacker can often reshape the message in ways the developer did not anticipate. That is why the real question is not “was some filtering applied”, but “did the extension reduce the content to plain text or a tightly bounded subset before rendering”.
Risk and Threat Considerations
When attacker-controlled Markdown is rendered with elevated trust, the risk is user deception, unsafe navigation, and content injection into surfaces the user assumes are extension-authored. In a developer tool, that can turn an ordinary repository artifact into a delivery mechanism for phishing, malicious links, or misleading operational guidance.
Failure mechanism: The extension treats untrusted workspace data as Markdown-safe, preserves rich constructs such as links or embedded formatting, and renders them in UI components that users trust more than raw file content.
Impact: Users may follow attacker-supplied links, misread repository context, or accept malicious content as legitimate extension output, increasing the chance of credential theft, malicious workflow actions, or downstream compromise.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 address the attack and risk surface, while CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| CIS Controls v8 | CIS Control 16 — Application Software Security | Controls unsafe content handling in extension and webview rendering paths. |
| CIS Control 3 — Data Protection | Rendered content from untrusted sources should be minimized and controlled. | |
| Recommendation — Validate and sanitize untrusted Markdown before rendering it in extension UI surfaces. Classify and constrain repository-derived content before displaying it in rich UI. | ||
| NIST CSF 2.0 | PR.DS-1 — Data-at-Rest is Protected | Untrusted repository content must be handled as data with constrained exposure. |
| PR.PT-1 — Protective Technology is Managed | Rendering boundaries and sanitization are protective controls for untrusted input. | |
| DE.CM-8 — Vulnerability Scans are Performed | Unsafe Markdown handling in extensions is a reviewable implementation weakness. | |
| Recommendation — Limit how untrusted workspace data is transformed into rendered UI content. Enforce trusted rendering only after content has been explicitly constrained. Scan extension code paths that convert repository text into rendered Markdown. | ||
| OWASP Agentic AI Top 10 | A3 — Tool and Output Abuse | Markdown-rendering sinks can be abused when untrusted content reaches privileged UI output. |
| A5 — Prompt and Content Injection | Attacker-controlled Markdown is a content injection problem in extension-generated UI. | |
| A7 — Unsafe External Communication | Markdown links can steer users to untrusted destinations when rendering is permissive. | |
| Recommendation — Treat every rendered output path as hostile until its inputs are validated. Block attacker-controlled content from influencing privileged rendered interfaces. Constrain link rendering and verify destinations before exposing them to users. | ||
Practitioner Guidance
What to verify: Check whether every Markdown-rendering path has an explicit trust decision and whether attacker-controlled data is reduced to plain text or a narrowly allowed subset before it reaches hover, preview, or webview surfaces. If the extension relies on “sanitisation” but still accepts raw Markdown from the repository, treat that as a design defect, not a tuning issue.
Common mistake: Developers often secure the obvious path, such as one preview widget, while leaving other rendering sinks untouched. For this class of bug, the important test is whether any sink can be reached with untrusted Markdown and a permissive renderer, because a single overlooked path is enough to preserve the attack surface.
Practitioner takeaway: The safest default is to assume workspace Markdown is hostile until it has been explicitly downgraded to inert text or validated against a strict policy, because “mostly sanitised” is usually still exploitable.
Related resources from NHI Mgmt Group
- What are the signs that a VS Code extension strategy is becoming unmanageable?
- What are the signs that a VS Code extension may be unsafe or misused?
- What breaks when a public-facing cloud app can execute attacker-controlled code?
- What breaks when a malicious VS Code extension can inherit a GitHub session silently?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on September 19, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org