# CVE-2026-21872: NiceGUI apps are vulnerable to XSS which uses `ui.sub_pages` and render arbitrary user-provided links

- Severity: Medium 6.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.34%, higher than 20% of CVEs (2026-11-30)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-01-08T09:50:02.801Z
- Modified: 2026-07-07T17:56:55.537Z
- Also known as: GHSA-m7j5-rq9j-6jj9, PYSEC-2026-1701
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

NiceGUI is a Python-based UI framework. From versions 2.22.0 to 3.4.1, an unsafe implementation in the click event listener used by ui.sub_pages, combined with attacker-controlled link rendering on the page, causes XSS when the user actively clicks on the link. This issue has been patched in version 3.5.0.

(As written by CVE List.)

## Affected

- zauberzeug nicegui: >= 2.22.0, < 3.5.0; from 2.22.0 before 3.5.0
- nicegui (PyPI): from 2.22.0 before 3.5.0

## Every score

- GitHub_M: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- PyPA Advisory Database: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/zauberzeug/nicegui/security/advisories/GHSA-m7j5-rq9j-6jj9> (exploit, vendor-advisory, web)
- <https://github.com/zauberzeug/nicegui/releases/tag/v3.5.0> (release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-21872> (advisory)
- <https://github.com/zauberzeug/nicegui> (package)
- <https://pypi.org/project/nicegui> (package)
- <https://github.com/advisories/GHSA-m7j5-rq9j-6jj9> (advisory)

## Sources

- CVE List: [CVE-2026-21872](https://www.cve.org/CVERecord?id=CVE-2026-21872), CVE Terms of Use, modified 2026-01-08
- GitHub Advisory Database: [GHSA-m7j5-rq9j-6jj9](https://github.com/advisories/GHSA-m7j5-rq9j-6jj9), CC-BY-4.0, modified 2026-07-07
- NVD: [CVE-2026-21872](https://nvd.nist.gov/vuln/detail/CVE-2026-21872), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1701](https://osv.dev/vulnerability/PYSEC-2026-1701), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2026-21872 · Whole record: https://cve.day/CVE-2026-21872.json · Rebuilt by cve.day 2026-11-25T22:59:12.660Z
