CVE-2026-21871: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in zauberzeug nicegui
CVE-2026-21871 is a cross-site scripting (XSS) vulnerability in the Python UI framework NiceGUI versions 2. 13. 0 to 3. 4. 1. The flaw arises when attacker-controlled input is passed into ui. navigate. history. push() or ui. navigate.
AI Analysis
Technical Summary
CVE-2026-21871 identifies a cross-site scripting (XSS) vulnerability in the NiceGUI Python UI framework, specifically in versions from 2.13.0 up to but not including 3.5.0. NiceGUI provides helpers ui.navigate.history.push() and ui.navigate.history.replace() that wrap the browser's History API to update the URL without triggering a page reload. The vulnerability occurs when these helpers are called with attacker-controlled strings that are embedded into generated JavaScript without proper escaping or sanitization. This improper neutralization of input (CWE-79) allows an attacker to craft a malicious URL argument that breaks out of the intended string context and injects arbitrary JavaScript code. When a victim's browser processes this malicious payload, the injected script executes with the privileges of the web application, potentially stealing sensitive information, manipulating the DOM, or performing actions on behalf of the user. Exploitation requires that the vulnerable application passes untrusted input into these navigation functions and that the victim interacts with the malicious link or payload. The vulnerability does not require authentication but does require user interaction (UI:R). The CVSS v3.1 base score is 6.1, reflecting a medium severity with network attack vector, low attack complexity, no privileges required, user interaction required, and impacts on confidentiality and integrity but not availability. The issue has been patched in NiceGUI version 3.5.0, which properly escapes or sanitizes input to prevent script injection. No known exploits are currently reported in the wild. Organizations using affected NiceGUI versions in web applications should prioritize upgrading and review their usage of these navigation APIs to ensure no untrusted input is passed. This vulnerability is particularly relevant for web applications that dynamically update URLs based on user input or external data sources.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to web applications built with NiceGUI versions 2.13.0 to 3.4.1 that incorporate untrusted user input into URL navigation functions. Successful exploitation can lead to arbitrary JavaScript execution in users' browsers, compromising confidentiality by exposing session tokens, cookies, or personal data. Integrity may be affected as attackers can manipulate the DOM or perform unauthorized actions on behalf of users. Although availability is not impacted, the reputational damage and potential regulatory consequences under GDPR for data leakage are significant. Sectors with high web application usage such as finance, healthcare, and public services are particularly vulnerable. The requirement for user interaction means phishing or social engineering may be used to lure victims. The medium severity score indicates a moderate but actionable threat. Organizations relying on NiceGUI for internal or customer-facing portals should assess their exposure and remediate promptly to avoid exploitation.
Mitigation Recommendations
1. Upgrade all NiceGUI instances to version 3.5.0 or later, where the vulnerability is patched. 2. Conduct a thorough code audit to identify any usage of ui.navigate.history.push() and ui.navigate.history.replace() functions, verifying that no untrusted or attacker-controlled input is passed to these APIs. 3. Implement strict input validation and sanitization on all user-supplied data that could influence URL navigation or JavaScript generation. 4. Employ Content Security Policy (CSP) headers to restrict the execution of unauthorized scripts in browsers. 5. Educate developers on secure coding practices related to client-side navigation and JavaScript injection risks. 6. Monitor web application logs and user reports for suspicious activity indicative of XSS exploitation attempts. 7. For applications where immediate upgrade is not feasible, consider applying runtime mitigations such as input filtering or disabling dynamic URL updates until patched. 8. Incorporate automated security testing tools that detect XSS vulnerabilities during development and deployment cycles.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden
CVE-2026-21871: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in zauberzeug nicegui
Description
CVE-2026-21871 is a cross-site scripting (XSS) vulnerability in the Python UI framework NiceGUI versions 2. 13. 0 to 3. 4. 1. The flaw arises when attacker-controlled input is passed into ui. navigate. history. push() or ui. navigate.
AI-Powered Analysis
Technical Analysis
CVE-2026-21871 identifies a cross-site scripting (XSS) vulnerability in the NiceGUI Python UI framework, specifically in versions from 2.13.0 up to but not including 3.5.0. NiceGUI provides helpers ui.navigate.history.push() and ui.navigate.history.replace() that wrap the browser's History API to update the URL without triggering a page reload. The vulnerability occurs when these helpers are called with attacker-controlled strings that are embedded into generated JavaScript without proper escaping or sanitization. This improper neutralization of input (CWE-79) allows an attacker to craft a malicious URL argument that breaks out of the intended string context and injects arbitrary JavaScript code. When a victim's browser processes this malicious payload, the injected script executes with the privileges of the web application, potentially stealing sensitive information, manipulating the DOM, or performing actions on behalf of the user. Exploitation requires that the vulnerable application passes untrusted input into these navigation functions and that the victim interacts with the malicious link or payload. The vulnerability does not require authentication but does require user interaction (UI:R). The CVSS v3.1 base score is 6.1, reflecting a medium severity with network attack vector, low attack complexity, no privileges required, user interaction required, and impacts on confidentiality and integrity but not availability. The issue has been patched in NiceGUI version 3.5.0, which properly escapes or sanitizes input to prevent script injection. No known exploits are currently reported in the wild. Organizations using affected NiceGUI versions in web applications should prioritize upgrading and review their usage of these navigation APIs to ensure no untrusted input is passed. This vulnerability is particularly relevant for web applications that dynamically update URLs based on user input or external data sources.
Potential Impact
For European organizations, this vulnerability poses a risk primarily to web applications built with NiceGUI versions 2.13.0 to 3.4.1 that incorporate untrusted user input into URL navigation functions. Successful exploitation can lead to arbitrary JavaScript execution in users' browsers, compromising confidentiality by exposing session tokens, cookies, or personal data. Integrity may be affected as attackers can manipulate the DOM or perform unauthorized actions on behalf of users. Although availability is not impacted, the reputational damage and potential regulatory consequences under GDPR for data leakage are significant. Sectors with high web application usage such as finance, healthcare, and public services are particularly vulnerable. The requirement for user interaction means phishing or social engineering may be used to lure victims. The medium severity score indicates a moderate but actionable threat. Organizations relying on NiceGUI for internal or customer-facing portals should assess their exposure and remediate promptly to avoid exploitation.
Mitigation Recommendations
1. Upgrade all NiceGUI instances to version 3.5.0 or later, where the vulnerability is patched. 2. Conduct a thorough code audit to identify any usage of ui.navigate.history.push() and ui.navigate.history.replace() functions, verifying that no untrusted or attacker-controlled input is passed to these APIs. 3. Implement strict input validation and sanitization on all user-supplied data that could influence URL navigation or JavaScript generation. 4. Employ Content Security Policy (CSP) headers to restrict the execution of unauthorized scripts in browsers. 5. Educate developers on secure coding practices related to client-side navigation and JavaScript injection risks. 6. Monitor web application logs and user reports for suspicious activity indicative of XSS exploitation attempts. 7. For applications where immediate upgrade is not feasible, consider applying runtime mitigations such as input filtering or disabling dynamic URL updates until patched. 8. Incorporate automated security testing tools that detect XSS vulnerabilities during development and deployment cycles.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-01-05T16:44:16.369Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 695f815bc901b06321d3fafc
Added to database: 1/8/2026, 10:05:15 AM
Last enriched: 1/15/2026, 12:40:58 PM
Last updated: 2/7/2026, 2:16:36 PM
Views: 92
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2026-2087: SQL Injection in SourceCodester Online Class Record System
MediumCVE-2026-2086: Buffer Overflow in UTT HiPER 810G
HighOrganizations Urged to Replace Discontinued Edge Devices
MediumCVE-2026-2085: Command Injection in D-Link DWR-M921
HighCVE-2026-2084: OS Command Injection in D-Link DIR-823X
HighActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.