The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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
    • 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-2023-5631

CVE-2023-5631: Roundcube Webmail XSS Vulnerability

CVE-2023-5631 is a stored XSS vulnerability in Roundcube Webmail that allows attackers to inject malicious JavaScript via crafted SVG documents in HTML emails. This article covers technical details, affected versions, and mitigations.

Published: February 11, 2026

CVE-2023-5631 Overview

CVE-2023-5631 is a stored Cross-Site Scripting (XSS) vulnerability in Roundcube Webmail that allows remote attackers to execute arbitrary JavaScript code through specially crafted SVG documents embedded in HTML email messages. The vulnerability exists in program/lib/Roundcube/rcube_washtml.php, where improper sanitization of SVG content in data URIs enables attackers to bypass security controls and inject malicious scripts.

Critical Impact

This vulnerability is actively exploited in the wild and has been added to CISA's Known Exploited Vulnerabilities (KEV) catalog. Attackers can steal session cookies, capture credentials, and perform actions on behalf of authenticated users by simply having victims view a malicious email.

Affected Products

  • Roundcube Webmail versions before 1.4.15
  • Roundcube Webmail versions 1.5.x before 1.5.5
  • Roundcube Webmail versions 1.6.x before 1.6.4
  • Debian Linux 10.0, 11.0, and 12.0
  • Fedora 39

Discovery Timeline

  • October 16, 2023 - Roundcube releases security patches (1.6.4, 1.5.5 and 1.4.15)
  • October 18, 2023 - CVE-2023-5631 published to NVD
  • October 30, 2025 - Last updated in NVD database

Technical Details for CVE-2023-5631

Vulnerability Analysis

The vulnerability resides in Roundcube's HTML sanitizer (rcube_washtml.php), which is responsible for filtering potentially dangerous content from incoming HTML emails. When processing embedded images with data URIs containing SVG content, the sanitizer failed to properly handle whitespace characters within the MIME type declaration. This flaw allowed attackers to craft malicious SVG payloads that could bypass the existing sanitization logic.

The issue specifically occurs when parsing data URIs in the format data:image/[type],[content]. The original code used the raw $matches[1] value directly to check for SVG content, but whitespace characters embedded in the type string could cause the SVG detection logic to fail while still allowing the browser to interpret the content as SVG.

Root Cause

The root cause is improper input validation in the data URI parsing logic. The vulnerable code did not strip whitespace from the MIME type portion of data URIs before performing security checks. Since browsers are tolerant of whitespace in data URIs, an attacker could insert spaces or other whitespace characters to evade the stripos($matches[1], 'svg') check while the browser would still render the content as an SVG image, including any embedded JavaScript.

Attack Vector

An attacker exploits this vulnerability by crafting an HTML email containing a malicious data URI with an SVG image. By inserting whitespace characters (such as newlines or spaces) into the MIME type declaration, the attacker bypasses Roundcube's SVG sanitization. When a victim views the email through the Roundcube webmail interface, the malicious JavaScript embedded in the SVG executes in the context of the victim's authenticated session. This requires network access and user interaction (viewing the email), but the attacker only needs low privileges to send emails to targets.

php
// Security patch in program/lib/Roundcube/rcube_washtml.php
// Source: https://github.com/roundcube/roundcubemail/commit/41756cc3331b495cc0b71886984474dc529dd31d

             }
         }
         else if ($is_image && preg_match('/^data:image\/([^,]+),(.+)$/is', $uri, $matches)) { // RFC2397
+            $type = preg_replace('/\s/', '', $matches[1]);
+
             // svg images can be insecure, we'll sanitize them
-            if (stripos($matches[1], 'svg') !== false) {
+            if (stripos($type, 'svg') !== false) {
                 $svg = $matches[2];

-                if (stripos($matches[1], ';base64') !== false) {
-                    $svg  = base64_decode($svg);
-                    $type = $matches[1];
+                if (stripos($type, ';base64') !== false) {
+                    $svg = base64_decode($svg);
                 }
                 else {
-                    $type = $matches[1] . ';base64';
+                    $type .= ';base64';
                 }

                 $washer = new self($this->config);

The patch adds preg_replace('/\s/', '', $matches[1]) to strip all whitespace characters from the MIME type before performing SVG detection, ensuring consistent sanitization regardless of whitespace manipulation.

Detection Methods for CVE-2023-5631

Indicators of Compromise

  • Presence of HTML emails containing data URIs with SVG content and unusual whitespace characters in MIME type declarations
  • JavaScript execution errors or unexpected script activity originating from the Roundcube webmail interface
  • Unusual outbound network connections from user browsers during email viewing sessions
  • Web server logs showing access patterns consistent with XSS payload delivery through email content

Detection Strategies

  • Monitor web application logs for suspicious data URI patterns, particularly those containing data:image/ with embedded whitespace or newline characters followed by svg
  • Implement Content Security Policy (CSP) headers to detect and block inline script execution attempts
  • Deploy web application firewalls (WAF) with rules to detect SVG-based XSS attack patterns in email content
  • Use browser-based security monitoring to detect unexpected script execution in the Roundcube application context

Monitoring Recommendations

  • Enable detailed logging for the Roundcube webmail application, particularly for HTML email rendering operations
  • Monitor for signs of session hijacking such as session tokens being accessed from multiple IP addresses simultaneously
  • Implement network traffic analysis to detect data exfiltration attempts that may follow successful XSS exploitation
  • Review email quarantine logs for messages containing suspicious SVG or data URI content

How to Mitigate CVE-2023-5631

Immediate Actions Required

  • Upgrade Roundcube Webmail immediately to version 1.6.4, 1.5.5, or 1.4.15 depending on your installed version branch
  • If immediate patching is not possible, consider temporarily disabling HTML email rendering in Roundcube configuration
  • Review web server and application logs for evidence of exploitation attempts
  • Force session invalidation for all users and require re-authentication after patching

Patch Information

Roundcube has released security patches addressing this vulnerability across all supported version branches. The fixes are available in version 1.6.4, version 1.5.5, and version 1.4.15. The security commits (41756cc3331b, 6ee6e7ae301e) modify program/lib/Roundcube/rcube_washtml.php to properly sanitize whitespace in data URI MIME types before SVG detection. Linux distribution users should apply patches via Debian Security Advisory DSA-5531, Debian LTS announcements, or Fedora package updates.

Workarounds

  • Configure Roundcube to display emails in plain text mode by default, disabling HTML rendering until patching is complete
  • Implement strict Content Security Policy headers to prevent inline JavaScript execution: Content-Security-Policy: script-src 'self'; object-src 'none'
  • Deploy a web application firewall with rules to filter emails containing suspicious SVG data URIs
  • Consider network-level email filtering to strip or quarantine HTML emails with embedded SVG content
bash
# Roundcube configuration workaround - config/config.inc.php
# Force plain text email display to mitigate XSS risk

# Add these lines to your config.inc.php
$config['prefer_html'] = false;
$config['show_images'] = 0;
$config['htmleditor'] = 0;

# Verify Roundcube version
grep -r "Version" /path/to/roundcube/index.php

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechRoundcube Webmail

  • SeverityMEDIUM

  • CVSS Score5.4

  • EPSS Probability84.50%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CISA KEV Information
  • In CISA KEVYes
  • CWE References
  • CWE-79
  • Technical References
  • Openwall OSS Security Discussion

  • Openwall OSS Security Discussion

  • Openwall OSS Security Discussion

  • Roundcube Issue #9168

  • Roundcube Release 1.4.15

  • Roundcube Release 1.5.5

  • Roundcube Release 1.6.4

  • Debian LTS Announcement

  • Fedora Package Announcement

  • Roundcube Security Update 1.6.4

  • Roundcube Security Updates 1.5.5 & 1.4.15

  • Debian Security Advisory DSA-5531

  • CISA Known Exploited Vulnerabilities Catalog
  • Vendor Resources
  • Debian Bug Report #1054079

  • Roundcube Commit #41756cc333

  • Roundcube Commit #6ee6e7ae30
  • Related CVEs
  • CVE-2025-68461: Roundcube Webmail XSS Vulnerability

  • CVE-2020-35730: Roundcube Webmail XSS Vulnerability

  • CVE-2023-43770: Roundcube Webmail XSS Vulnerability

  • CVE-2024-37383: Roundcube Webmail XSS Vulnerability
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