MEDIUM 6.1

CVE-2026-59710: Stored XSS in Showdown Markdown Parser Table Headers

Showdown, a popular markdown-to-HTML converter, contains a stored cross-site scripting (XSS) vulnerability in how it processes table headers. When markdown containing malicious content is rendered using the default GitHub flavor configuration, an attacker can inject arbitrary HTML and JavaScript-executing SVG elements through specially crafted double-quote characters in table header text. Once injected, the malicious code persists in the rendered output and executes in the browsers of anyone viewing the content. This is particularly dangerous in applications that accept user-submitted markdown and display it to other users without sanitization.

Source data · NVD / CISA · public domain

CVSS
3.1 · 6.1 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Weaknesses (CWE)
CWE-79
Affected products
0 configuration(s)
Published / Modified
2026-07-06 / 2026-07-07

NVD description (verbatim)

showdown contains a stored cross-site scripting vulnerability in the parseHeaders function of src/subParsers/makehtml/tables.js that fails to properly escape table header ID attributes. Attackers can inject arbitrary HTML and script-executing SVG elements through double-quote characters in markdown table headers, achieving stored XSS when untrusted markdown is rendered with the default github flavor configuration.

5 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability exists in the parseHeaders function within src/subParsers/makehtml/tables.js. The function constructs table header ID attributes from markdown input but fails to properly escape or validate double-quote characters. An attacker can terminate an attribute value prematurely and inject arbitrary HTML attributes or SVG elements with event handlers (such as onload or onerror) that execute JavaScript. The flaw is triggered when untrusted markdown is processed with showdown's default GitHub flavor parser, which is commonly used to render user-generated content in web applications. The resulting XSS payload is stored in the rendered HTML output, causing the attack to persist across multiple page views and user sessions.

Business impact

Organizations using showdown to render user-submitted or third-party markdown face a significant data breach and account compromise risk. Attackers can steal session tokens, API credentials, or authentication cookies from users viewing malicious markdown. In customer-facing applications, this enables cross-user attacks where one malicious actor compromises the experience and data of many legitimate users. If markdown is stored in a database and rendered dynamically, the attack scales automatically. Teams using showdown for documentation, knowledge bases, comment systems, or collaborative tools should assess whether they accept untrusted markdown input and whether rendering happens in customer-facing contexts.

Affected systems

Showdown is a JavaScript markdown parser commonly embedded in Node.js applications, static site generators, and browser-based markdown editors. The vulnerability affects all versions that include the vulnerable parseHeaders function. Applications are at risk only if they: (1) use showdown to process untrusted markdown, (2) render the output in a web browser without additional HTML sanitization, and (3) serve the rendered content to multiple users. Applications that only parse trusted markdown (internal documentation, pre-approved content) or that apply aggressive HTML sanitization downstream are lower-risk.

Exploitability

Exploitability is straightforward for attackers with the ability to submit markdown input to an application. The attack requires no authentication in systems where markdown submission is open, and no special tools—only crafted markdown text containing double-quote characters in table headers. User interaction is required (a victim must view the rendered page), which is typically guaranteed in multi-user platforms. The CVSS score of 6.1 (MEDIUM) reflects the network accessibility, low complexity, and moderate impact of credential theft or session hijacking balanced against the requirement for user interaction and the limitation of confidentiality and integrity (not availability) damage.

Remediation

Immediate remediation requires updating showdown to a patched version that properly escapes or validates ID attribute values in the parseHeaders function. Verify the specific patched version number against the official showdown release notes and security advisories. As an interim measure, if immediate patching is not feasible, apply HTML sanitization to all rendered markdown output using a library like DOMPurify or html-sanitizer before serving it to browsers. Additionally, implement a Content Security Policy (CSP) that restricts inline script execution, which will mitigate many XSS payloads even if they are injected. Audit applications to identify where untrusted markdown is being processed and prioritize patching in those contexts.

Patch guidance

Check the showdown GitHub repository and official npm package for security advisories and version release notes. Patches for stored XSS vulnerabilities are typically released as patch or minor versions. After updating, test markdown rendering, especially tables with special characters, to ensure the fix does not break legitimate formatting. Redeploy updated dependencies across all environments where showdown is used. If you have stored markdown content in your database that was rendered before patching, consider re-rendering it with the patched version to ensure no residual XSS payloads remain in cached HTML.

Detection guidance

Monitor logs for markdown submissions containing double-quote characters in table header syntax (markdown tables with pipes and quotes). Implement browser-based XSS detection using Content Security Policy violation reports; CSP will block inline scripts and report attempts to execute injected code. Network security teams should watch for unusual SVG element injection in HTTP responses from applications known to use showdown. If you have already rendered markdown in a database, use automated HTML parsing tools to scan stored HTML for suspicious SVG tags with event handlers or mismatched HTML attributes that might indicate past exploitation.

Why prioritize this

Although the CVSS score is MEDIUM, the vulnerability warrants expedited patching because stored XSS in markdown rendering can compromise large user bases simultaneously. Unlike reflected XSS, a single malicious markdown submission can affect thousands of users passively. Showdown is widely used, making it a common supply-chain exposure. Organizations accepting user-generated markdown should treat this as high-priority. Applications handling only internal or pre-vetted markdown can deprioritize slightly, but confirmation of input trust is essential before deferring patches.

Risk score, explained

The CVSS 3.1 score of 6.1 (MEDIUM) reflects: Attack Vector = Network (accessible remotely), Attack Complexity = Low (no special conditions), Privileges Required = None (open submission), User Interaction = Required (victim views page), Scope = Changed (XSS can affect other users and the application context), Confidentiality Impact = Low (session/credential theft), Integrity Impact = Low (malicious content injected), Availability Impact = None (no denial of service). The score appropriately captures the broad reach and persistent nature of the threat while acknowledging that the attack requires user browsing activity and affects individual users rather than system availability.

Frequently asked questions

Does this vulnerability affect applications that sanitize markdown output?

No. If your application applies HTML sanitization (e.g., DOMPurify, html-sanitizer) to all rendered markdown before displaying it to users, the injected scripts will be stripped and the vulnerability will be mitigated. However, you should still patch showdown to address the root cause and reduce your reliance on downstream sanitization as a defense layer.

Can this vulnerability be exploited if markdown is stored as plain text and never rendered to HTML?

No. The vulnerability only manifests when untrusted markdown is processed by showdown and the resulting HTML is rendered in a browser. If you store markdown as plain text and do not render it with showdown (for example, if you only display it as a code block), you are not exposed to this XSS attack.

Does Content Security Policy prevent this attack?

A strict CSP that blocks inline scripts (script-src 'self') will prevent many variants of this XSS attack, including those that inject onload or onerror event handlers on SVG elements. However, CSP alone is not a complete fix—you should still patch showdown, because an attacker might find CSP bypasses or your CSP may need to allow trusted inline scripts for other legitimate purposes.

What is the scope of affected markdown syntax?

The vulnerability is triggered specifically through double-quote characters in markdown table headers (the row between pipes). Attackers craft table headers that close the ID attribute and inject new HTML attributes or SVG elements. Other markdown elements (paragraphs, lists, code blocks) are not directly affected by this particular flaw in parseHeaders, though you should always treat untrusted markdown defensively.

This analysis is provided for informational purposes to help security teams assess and remediate exposure to CVE-2026-59710. It is not a substitute for vendor security advisories or your organization's own vulnerability assessment. Verify all patch versions, affected product configurations, and compatibility requirements against official showdown releases before deploying updates. SEC.co does not warrant the completeness or accuracy of third-party vulnerability data and recommends consulting official vendor documentation and your security tools for definitive remediation guidance. Source: NVD (public-domain), retrieved 2026-08-15. Analysis generated by SEC.co (claude-haiku-4-5).