XSS on kubernetes-csi.github.io (mdBook)
The mdBook documentation generator had a cross-site scripting flaw in its search feature, allowing an attacker to inject script via a crafted search query. An attacker could execute arbitrary JavaScript in a victim's browser when they visit a specially crafted link.
Kamil Vavra Follow with hackforgood
Originally disclosed on HackerOne
- Triaged in 19 hours
- Disclosed after 28 days
Report Submission Form
Summary:
Hi,
I have recently found XSS vulnerability in mdBook (CVE-2020-26297), fixed and disclosed on 4th January 2020. The details were published in a security advisory here: https://blog.rust-lang.org/2021/01/04/mdbook-security-advisory.html
I did a quick recon and found a couple of vulnerable endpoints:
- https://capz.sigs.k8s.io
- https://cluster-api-aws.sigs.k8s.io
- https://cluster-api.sigs.k8s.io
- https://image-builder.sigs.k8s.io
- https://kubernetes-csi.github.io
- https://master.cluster-api.sigs.k8s.io
- https://release-0-2.cluster-api.sigs.k8s.io
- https://secrets-store-csi-driver.sigs.k8s.io
... where the https://kubernetes-csi.github.io/docs/ is in scope. Update to the latest version and
I understand if this is not eligible for a bounty, as you didn't have enough time to fix this. On the other hand, I decided to report it anyway, in case you missed it. And because I wasn't able to find any info grading grace period for 0days or new CVEs in your policy.
Kind regards,
Kamil Vavra @vavkamil
Steps To Reproduce:
a) Payload used: x"->xss<img/src/onerror%3Dalert(1)>
b) PoC: https://kubernetes-csi.github.io/docs/?search=x"->xss<img/src/onerror%3Dalert(1)>
- Visit https://kubernetes-csi.github.io/docs/?search=x%22%2D%3Exss%3Cimg%2Fsrc%2Fonerror%3Dalert%281%29%3E
- You should see the XSS executed
Mitigations:
Owners of websites built with mdBook have to upgrade to mdBook 0.4.5 or greater and rebuild their website contents with it.
Supporting Material/References:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-26297
Impact
I guess the impact here is minimal, so I submitted it with low severity.
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
Impact
The impact is minimal, as the attacker could execute JavaScript in a victim's browser only if the victim visits a specially crafted link.
What the attacker needed
Victim clicks a crafted link
The fix
Website owners should upgrade to mdBook 0.4.5 or greater and rebuild their site.
How it was found
- Visit the crafted URL containing the search parameter with the payload.
- Observe that the XSS payload executes in the browser.
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.
Cross-site scripting (XSS) is when a website lets an attacker sneak harmful code into a page that other people view. Here, the search box on a documentation site didn't clean up what users typed, so a link could contain code that runs when clicked. The fix is to update the software that builds the site.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.