Skip to content
XSS Advisory Intermediate

GHSL-2021-1058_GHSL-2021-1060: Cross-Site Scripting (XSS) in mermaid.js

ghsecuritylab Follow

Originally disclosed on GitHub Security Lab

The function sanitizeUrl used to replace dangerous characters in a user supplied string can be bypassed by taking advantage of the fact that it will replace the string javascript: with an empty character. This allows an attacker to craft a string that when sanitized once it will output a dangerous string.

ghsecuritylab, 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.

What is known

A XSS bug. GitHub Security Lab made it public on 12 January 2022.

About XSS

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

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

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 ghsecuritylab

View all

132 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.