# GHSA-w32g-5hqp-gg6q: Cross-Site Scripting in mermaid

- Severity: High (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2020-09-02T15:41:41.000Z
- Modified: 2021-09-27T13:34:07.000Z
- Weaknesses: CWE-79

## Description

Versions of `mermaid` prior to 8.2.3 are vulnerable to Cross-Site Scripting. If malicious input  such as `A["<img src=invalid onerror=alert('XSS')></img>"] ` is provided to the application, it will execute the code instead of rendering it as text due to improper output encoding.


## Recommendation

Upgrade to version 8.2.3 or later

(As written by GitHub Advisory Database.)

## Affected

- mermaid (npm): before 8.2.3

## References

- <https://github.com/knsv/mermaid/issues/847> (web)
- <https://github.com/knsv/mermaid> (package)
- <https://www.npmjs.com/advisories/751> (web)

## Sources

- GitHub Advisory Database: [GHSA-w32g-5hqp-gg6q](https://github.com/advisories/GHSA-w32g-5hqp-gg6q), CC-BY-4.0, modified 2021-09-27

---

Page: https://cve.day/GHSA-w32g-5hqp-gg6q · Whole record: https://cve.day/GHSA-w32g-5hqp-gg6q.json · Rebuilt by cve.day 2026-11-25T22:56:46.754Z
