Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-104477 Overview
CVE-2026-104477 is a cross-site scripting (XSS) vulnerability in the Showdown Markdown-to-HTML converter through version 2.1.0. The makehtml link and image subparsers fail to escape double-quote characters inside destination URLs before placing them into href and src attributes. Attackers can craft a Markdown link or image whose URL contains a double quote followed by an event handler such as onerror or onmouseover. When Showdown renders the Markdown, the injected handler escapes the quoted attribute and executes attacker-controlled JavaScript in the viewer's browser context. The flaw is tracked under CWE-79.
Critical Impact
Rendered Markdown from untrusted sources can execute arbitrary JavaScript in any application that embeds Showdown 2.1.0 or earlier, enabling session theft, UI redress, and client-side account takeover.
Affected Products
- Showdown Markdown converter versions through 2.1.0
- Web applications and services that render user-supplied Markdown with Showdown
- Node.js and browser integrations consuming the showdown npm package
Discovery Timeline
- 2026-10-03 - CVE-2026-104477 published to the National Vulnerability Database (NVD)
- 2026-10-06 - Last updated in NVD database
Technical Details for CVE-2026-104477
Vulnerability Analysis
Showdown converts Markdown link syntax such as [text](url) into HTML anchors and image syntax  into <img> tags. The link and image subparsers normalize the URL and escape a limited set of characters, but they do not neutralize the double-quote character used to delimit the HTML attribute value. An attacker-controlled URL containing " therefore terminates the attribute early and allows arbitrary additional attributes to be injected into the generated tag. Because the injection occurs inside an already-trusted HTML sink, downstream Content Security Policy or output filters that only inspect Markdown input will not catch the payload.
Root Cause
The root cause is incomplete output encoding in src/subParsers/makehtml/link.js and src/subParsers/makehtml/image.js. The parsers call cmNormalizeURL and a regex-based escape for asterisks, dashes, tildes, and colons, but omit encoding for ", <, and >. The fix in commit 4fb992c adds HTML entity replacement for those three characters before the URL is written to the href or src attribute.
Attack Vector
Exploitation requires an attacker to supply Markdown that will be rendered by a vulnerable Showdown instance and viewed by a victim. The attack is remote, requires no privileges, and requires user interaction only to the extent that the victim must load the rendered page. A representative payload is [click](https://a.tld/" onmouseover="alert(1)) which produces an anchor whose href is prematurely closed and augmented with an onmouseover handler.
// Patch in src/subParsers/makehtml/link.js (commit 4fb992c)
url = showdown.helper.cmNormalizeURL(url);
}
url = url.replace(showdown.helper.regexes.asteriskDashTildeAndColon, showdown.helper.escapeCharactersCallback);
+ // escape characters that would otherwise break out of the quoted href attribute
+ // (a `"` in the destination is an attribute-injection vector). cmSpec flavors already
+ // percent-encode the URL above, so this is a no-op there.
+ url = url
+ .replace(/"/g, '"')
+ .replace(/</g, '<')
+ .replace(/>/g, '>');
attributes.href = url;
Source: GitHub Commit 4fb992c
// Equivalent patch in src/subParsers/makehtml/image.js (commit 4fb992c)
url = showdown.helper.cmNormalizeURL(url);
}
url = url.replace(showdown.helper.regexes.asteriskDashTildeAndColon, showdown.helper.escapeCharactersCallback);
+ // escape characters that would otherwise break out of the quoted src attribute
+ url = url
+ .replace(/"/g, '"')
+ .replace(/</g, '<')
+ .replace(/>/g, '>');
Source: GitHub Commit 4fb992c
Detection Methods for CVE-2026-104477
Indicators of Compromise
- Rendered HTML containing anchor or image tags where href or src attributes include unexpected event handlers such as onerror=, onmouseover=, onclick=, or onload=.
- Stored Markdown records containing a raw " inside a link destination followed by alphabetic characters, for example ](http://... " on.
- Browser console or CSP violation reports from pages that render user-supplied Markdown through Showdown.
Detection Strategies
- Perform a software composition analysis (SCA) scan of application dependencies and flag any showdown package resolution at version 2.1.0 or earlier.
- Add a server-side regex check on stored Markdown bodies that matches \]\([^)]*"\s*on[a-z]+= to surface injection attempts for triage.
- Instrument the Markdown rendering pipeline to log any output <a> or <img> tag whose attribute count exceeds the expected baseline of href/src, title, and alt.
Monitoring Recommendations
- Monitor web application firewall (WAF) logs for POST and PUT requests to comment, wiki, and issue endpoints containing double quotes inside Markdown link syntax.
- Alert on client-side CSP script-src violations originating from pages that render third-party Markdown content.
- Review authentication and session telemetry for anomalous activity from users who viewed Markdown-rendered content shortly before the event.
How to Mitigate CVE-2026-104477
Immediate Actions Required
- Upgrade the showdown dependency to the patched release that includes commit 4fb992c across all build artifacts, container images, and client bundles.
- Audit stored Markdown content for existing payloads matching the double-quote plus event-handler pattern and sanitize or remove affected records.
- Enforce a strict Content Security Policy that disables inline event handlers and inline script execution on pages rendering Markdown.
Patch Information
The vulnerability is fixed by commit 4fb992c in the Showdown repository, which adds HTML entity encoding for ", <, and > in both the link and image subparsers before the value is assigned to the href or src attribute. The VulnCheck advisory tracks the fix and affected versions.
Workarounds
- Post-process Showdown output with a hardened HTML sanitizer such as DOMPurify before serving it to end users.
- Pre-filter inbound Markdown to reject or encode " characters appearing inside the destination component of link and image syntax.
- Serve rendered Markdown with a Content-Security-Policy header that forbids inline event handlers (script-src 'self', no 'unsafe-inline').
# Pin and upgrade the Showdown dependency once a release containing commit 4fb992c is published
npm ls showdown
npm install showdown@latest --save
npm audit --production
# Example hardening: sanitize Showdown output with DOMPurify before rendering
# const html = DOMPurify.sanitize(new showdown.Converter().makeHtml(markdown));
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

