GHSA-m7j5-rq9j-6jj9 — nicegui
MEDIUMGHSA-m7j5-rq9j-6jj9 is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in nicegui. A fix is available for nicegui — see the affected versions and patch details below.
NiceGUI apps are vulnerable to XSS which uses `ui.sub_pages` and render arbitrary user-provided links
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for GHSA-m7j5-rq9j-6jj9.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-m7j5-rq9j-6jj9 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 377,333 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
niceguiReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Summary
An unsafe implementation in the click event listener used by ui.sub_pages, combined with attacker-controlled link rendering on the page, causes an XSS when the user actively clicks on the link.
Details
-
On
click, eventuallysub_pages_navigateevent is emitted. https://github.com/zauberzeug/nicegui/blob/59fa9424c470f1b12c5d368985fa36e21fda706b/nicegui/elements/sub_pages.js#L41-L63 -
SubPagesRouter (used by ui.sub_pages), lisnening on
sub_pages_navigate,_handle_navigateruns. https://github.com/zauberzeug/nicegui/blob/59fa9424c470f1b12c5d368985fa36e21fda706b/nicegui/sub_pages_router.py#L18-L22 -
_handle_navigaterunsrun_javascriptwith f-string substitutingself.current_pathwhich is simply surrounded by double-quotes. The string context can be broken out easily.
PoC
The minimal PoC boils down to this:
from nicegui import ui
ui.sub_pages({'/': lambda: ui.link('Go to XSS', '/"+alert(1)+"')})
ui.run()
However, it is more likely that the attack takes place with attacker-controlled input, for which this shows it:
from nicegui import app, ui
ui.sub_pages({'/': lambda: ui.label('Hello, World!')})
ui.textarea('Markdown content').bind_value(app.storage.general, 'markdown_content')
ui.markdown().bind_content_from(app.storage.general, 'markdown_content')
ui.run()
Vulnerable input is [XSS LINK](/"+alert(document.domain)+") (causes double payload execution, though)
Both cases require someone to click on the link.
<img width="1428" height="254" alt="image" src="https://github.com/user-attachments/assets/8be4f345-c0cf-4df2-9917-677a2ea72626" />Impact
Any page which uses ui.sub_pages and renders arbitrary links on screen (common case of ui.markdown) is affected.
The impact is low since a click is always required from the user, who can on-hover to discover the sketchy content of the link and stop if well-trained.
Appendix
AI is used safely to judge the CVSS scoring (input is not even provided, just the impact statement).
Please find the results in https://poe.com/s/y5DvyqgtszDGLUuHin1O
Scoring update after manual review
- Scope Changed is more inline with other posted XSS vulnerabilities
- Availability None: No DDoS is possible with this. Site remains performant as ever.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | nicegui | ≥ 2.22.0&&< 3.5.0 | 3.5.0pip install --upgrade 'nicegui==3.5.0' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for nicegui, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update nicegui to 3.5.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-m7j5-rq9j-6jj9 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-m7j5-rq9j-6jj9 can be triaged on real exposure rather than presence alone.
Tailored to GHSA-m7j5-rq9j-6jj9. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-m7j5-rq9j-6jj9 in your dependencies?
O3 Security finds GHSA-m7j5-rq9j-6jj9 across PyPI dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.