Skip to content
XSS Advisory Intermediate CVE-2026-73295

GHSL-2026-151: Crafted search links can execute JavaScript on mkdocs-material sites - CVE-2026-73295

The search suggestion feature in mkdocs-material wrote the visitor-controlled ?q= URL parameter into innerHTML without escaping, so a crafted link could execute JavaScript in the documentation site's origin. An attacker could lure a visitor to such a link and run arbitrary script in the victim's browser.

p Follow

Originally disclosed on GitHub Security Lab

mkdocs-material’s search suggestion allowed crafted links to execute JavaScript in the origin of documentation sites that enable the feature.

p-, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The search suggestion component wrote the joined search words, derived from the ?q= URL parameter, directly to innerHTML without HTML-escaping.

Impact

An attacker who lures a visitor to a crafted ?q= link could execute arbitrary JavaScript in the documentation site's origin, reading or writing same-origin storage and cookies, making same-origin requests, and rendering phishing UI; impact is greater when docs share an origin with an authenticated application.

What the attacker needed

Search.suggest feature enabled; victim clicks a crafted ?q= link

The fix

The vulnerability was fixed in a released advisory by escaping the search words before writing them to the page.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A documentation site built with mkdocs-material has a search box that shows suggestions as you type. The code took the search text from the web address and inserted it into the page as raw HTML instead of plain text. That meant a link could contain hidden HTML and script, and when a visitor opened it the script would run as if it came from the documentation site itself.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by p

View all

49 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.