# CVE-2026-21871: NiceGUI is vulnerable to XSS via Unescaped URL in ui.navigate.history.push() / replace()

- 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.27%, higher than 21% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-01-08T09:49:55.136Z
- Modified: 2026-07-07T17:57:28.403Z
- Also known as: GHSA-7grm-h62g-5m97, PYSEC-2026-1698
- 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.13.0 to 3.4.1, there is a XSS risk in NiceGUI when developers pass attacker-controlled strings into ui.navigate.history.push() or ui.navigate.history.replace(). These helpers are documented as History API wrappers for updating the browser URL without page reload. However, if the URL argument is embedded into generated JavaScript without proper escaping, a crafted payload can break out of the intended string context and execute arbitrary JavaScript in the victim’s browser. Applications that do not pass untrusted input into ui.navigate.history.push/replace are not affected. This issue has been patched in version 3.5.0.

(As written by CVE List.)

## Affected

- zauberzeug nicegui: >= 2.13.0, < 3.5.0; from 2.13.0 before 3.5.0
- nicegui (PyPI): from 2.13.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-7grm-h62g-5m97> (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-21871> (advisory)
- <https://github.com/zauberzeug/nicegui> (package)
- <https://pypi.org/project/nicegui> (package)
- <https://github.com/advisories/GHSA-7grm-h62g-5m97> (advisory)

## Sources

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

---

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