PyPI: mercury
CVE-2026-111059
Safety vulnerability ID: SFTY-20261019-84254
Affected versions of the `mercury` package are vulnerable to Cross-site Scripting (XSS) due to the `mr.Markdown` widget rendering its input as raw, unsanitized HTML. `MarkdownWidget._to_html()` in `mercury/md.py` converts the text with python-markdown, which passes inline HTML through unchanged, and `MarkdownWidget`, a subclass of `ipywidgets.HTML`, writes the result into the page through `innerHTML`, so payloads such as `<img src=x onerror=...>`, `<svg onload=...>` and `javascript:` links reach the DOM intact. An attacker who can place content in data that a Mercury app passes to `mr.Markdown`, such as a database row, a form submission, an uploaded file or an external API response, can run JavaScript in the browser of every user who views the app, allowing session hijacking, actions performed as the victim or tampering with the displayed page.
Overview
Mercury: Stored / DOM Cross-Site Scripting (XSS): mr.Markdown renders untrusted content as raw, unsanitized HTML
Advisory
mercury – Cross-site Scripting (XSS)
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20261019-84254/CVE-2026-111059
- https://github.com/mljar/mercury/security/advisories/GHSA-2658-85cv-9wwq
- https://github.com/mljar/mercury/commit/c798a85924e6614c6fea7afe5a560e4554a1d09b
- https://github.com/mljar/mercury/releases/tag/v3.2.11
- https://github.com/advisories/GHSA-2658-85cv-9wwq
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
