Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-25516

CVE-2026-25516: NiceGUI ui.markdown() XSS Vulnerability

CVE-2026-25516 is a cross-site scripting flaw in NiceGUI's ui.markdown() component that allows attackers to inject malicious JavaScript through unsanitized HTML. This article covers technical details, affected versions, and fixes.

Published: February 13, 2026

CVE-2026-25516 Overview

CVE-2026-25516 is a Cross-Site Scripting (XSS) vulnerability in NiceGUI, a Python-based UI framework. The ui.markdown() component uses the markdown2 library to convert markdown content to HTML, which is then rendered via innerHTML. By default, markdown2 allows raw HTML to pass through unchanged, meaning that if an application renders user-controlled content through ui.markdown(), an attacker can inject malicious HTML containing JavaScript event handlers. Unlike other NiceGUI components that render HTML (ui.html(), ui.chat_message(), ui.interactive_image()), the ui.markdown() component does not provide or require a sanitize parameter, leaving applications vulnerable to XSS attacks.

Critical Impact

Applications using NiceGUI's ui.markdown() component to render user-controlled content are vulnerable to XSS attacks, potentially allowing attackers to steal session tokens, perform actions on behalf of users, or redirect victims to malicious sites.

Affected Products

  • NiceGUI versions prior to 3.7.0
  • Applications using ui.markdown() to render user-controlled content

Discovery Timeline

  • 2026-02-06 - CVE CVE-2026-25516 published to NVD
  • 2026-02-09 - Last updated in NVD database

Technical Details for CVE-2026-25516

Vulnerability Analysis

This vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation) stems from inconsistent sanitization practices within the NiceGUI framework. While several HTML-rendering components like ui.html(), ui.chat_message(), and ui.interactive_image() include a sanitize parameter to protect against XSS attacks, the ui.markdown() component lacks this security control.

The markdown2 library, used by NiceGUI to convert markdown to HTML, preserves raw HTML by default. When this converted content is rendered using innerHTML without sanitization, any embedded JavaScript event handlers execute in the user's browser context.

Root Cause

The root cause is the absence of HTML sanitization in the ui.markdown() component's rendering pipeline. While other NiceGUI components implement sanitization options, ui.markdown() was implemented without this security control, creating an inconsistent security posture within the framework.

Attack Vector

An attacker can exploit this vulnerability by submitting markdown content containing malicious HTML with JavaScript event handlers. When a victim views this content through an application using ui.markdown(), the unsanitized HTML is rendered, and the JavaScript executes in their browser context.

Example attack payloads could include HTML elements with onerror, onload, or onclick event handlers embedded within markdown content. The attack requires user interaction (viewing the malicious content) and occurs over the network.

python
# Security patch in extract_core_libraries.py - Merge commit from fork
# Source: https://github.com/zauberzeug/nicegui/commit/f1f7533577875af7d23f161ed3627f73584cb561

              STATIC / 'unocss' / 'preset-wind3.global.js')
 shutil.copy2(NODE_MODULES / '@unocss' / 'runtime' / 'preset-wind4.global.js',
              STATIC / 'unocss' / 'preset-wind4.global.js')
+
+_minify_js(NODE_MODULES / 'dompurify' / 'dist' / 'purify.es.mjs', STATIC / 'dompurify.mjs')

The fix introduces DOMPurify, a well-known sanitization library, to sanitize markdown-rendered HTML before it is inserted into the DOM.

Detection Methods for CVE-2026-25516

Indicators of Compromise

  • Review application logs for suspicious markdown submissions containing HTML tags with event handlers (e.g., onerror, onload, onclick)
  • Monitor for unexpected JavaScript execution or unusual network requests from client browsers
  • Check for user-submitted content containing raw HTML within markdown fields
  • Look for encoded JavaScript payloads within markdown input fields

Detection Strategies

  • Implement Content Security Policy (CSP) headers to detect and block inline script execution
  • Deploy Web Application Firewall (WAF) rules to detect HTML injection attempts in markdown fields
  • Use browser-based XSS auditing tools during security testing
  • Monitor client-side errors and unexpected script execution events

Monitoring Recommendations

  • Enable detailed logging for all markdown content submissions
  • Set up alerts for HTML tags in user-submitted markdown content
  • Monitor for CSP violation reports indicating potential XSS attempts
  • Track unusual user session behavior that might indicate session hijacking

How to Mitigate CVE-2026-25516

Immediate Actions Required

  • Upgrade NiceGUI to version 3.7.0 or later immediately
  • Audit existing applications for any use of ui.markdown() with user-controlled content
  • Implement server-side input sanitization as an additional defense layer
  • Deploy Content Security Policy headers to mitigate XSS impact

Patch Information

The vulnerability is fixed in NiceGUI version 3.7.0. The patch introduces DOMPurify integration to sanitize HTML content before rendering. For detailed patch information, see the GitHub Security Advisory GHSA-v82v-c5x8-w282 and the commit f1f7533.

Workarounds

  • Avoid rendering user-controlled content through ui.markdown() until the patch is applied
  • Implement server-side HTML sanitization using libraries like bleach before passing content to ui.markdown()
  • Use alternative NiceGUI components with sanitization support (e.g., ui.html() with sanitize=True)
  • Apply strict Content Security Policy headers to limit the impact of any XSS exploitation
bash
# Configuration example - Upgrade NiceGUI to patched version
pip install --upgrade nicegui>=3.7.0

# Verify installed version
pip show nicegui | grep Version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechNicegui

  • SeverityMEDIUM

  • CVSS Score6.1

  • EPSS Probability0.03%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Commit Update

  • GitHub Security Advisory GHSA-v82v-c5x8-w282
  • Related CVEs
  • CVE-2026-27156: Zauberzeug Nicegui XSS Vulnerability

  • CVE-2026-21871: NiceGUI XSS Vulnerability

  • CVE-2026-21872: NiceGUI Python Framework XSS Vulnerability

  • CVE-2026-21873: NiceGUI Python Framework XSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English