# CVE-2026-27156: NiceGUI has XSS via Code Injection

- 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.20%, higher than 10% of CVEs (2026-12-01)
- Published: 2026-02-24T17:00:21.628Z
- Modified: 2026-07-13T07:26:13.919Z
- Also known as: GHSA-78qv-3mpx-9cqq, PYSEC-2026-2232
- Weaknesses: CWE-79
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

NiceGUI is a Python-based UI framework. Prior to version 3.8.0, several NiceGUI APIs that execute methods on client-side elements (`Element.run_method()`, `AgGrid.run_grid_method()`, `EChart.run_chart_method()`, and others) use an `eval()` fallback in the JavaScript-side `runMethod()` function. When user-controlled input is passed as the method name, an attacker can inject arbitrary JavaScript that executes in the victim's browser. Additionally, `Element.run_method()` and `Element.get_computed_prop()` used string interpolation instead of `json.dumps()` for the method/property name, allowing quote injection to break out of the intended string context. Version 3.8.0 contains a fix.

(As written by CVE List.)

## Affected

- zauberzeug nicegui: < 3.8.0; before 3.8.0
- nicegui (PyPI): before 3.8.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-78qv-3mpx-9cqq> (advisory, mitigation, vendor-advisory, web)
- <https://github.com/zauberzeug/nicegui/commit/1861f59cc374ca0dc9d970b157ef3774720f8dbf> (fix, patch, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-27156> (advisory)
- <https://github.com/zauberzeug/nicegui> (package)

## Sources

- CVE List: [CVE-2026-27156](https://www.cve.org/CVERecord?id=CVE-2026-27156), CVE Terms of Use, modified 2026-02-26
- GitHub Advisory Database: [GHSA-78qv-3mpx-9cqq](https://github.com/advisories/GHSA-78qv-3mpx-9cqq), CC-BY-4.0, modified 2026-07-13
- NVD: [CVE-2026-27156](https://nvd.nist.gov/vuln/detail/CVE-2026-27156), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-2232](https://osv.dev/vulnerability/PYSEC-2026-2232), CC-BY-4.0, modified 2026-07-13

---

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