SentinelOne
CVE Vulnerability Database
Vulnerability Database/CVE-2020-13965

CVE-2020-13965: Roundcube Webmail XSS Vulnerability

CVE-2020-13965 is an XSS flaw in Roundcube Webmail that allows attackers to execute malicious scripts via XML attachments. This post covers the technical details, affected versions, security impact, and mitigation steps.

Published:

CVE-2020-13965 Overview

CVE-2020-13965 is a Cross-Site Scripting (XSS) vulnerability discovered in Roundcube Webmail affecting versions before 1.3.12 and 1.4.x before 1.4.5. The vulnerability exists because text/xml is among the allowed MIME types for attachment preview, enabling attackers to craft malicious XML attachments that execute arbitrary JavaScript code in the context of a victim's browser session when previewed.

This vulnerability has been added to the CISA Known Exploited Vulnerabilities (KEV) catalog, indicating active exploitation in the wild. Organizations using vulnerable versions of Roundcube Webmail should prioritize remediation immediately.

Critical Impact

Attackers can execute arbitrary JavaScript in authenticated user sessions via specially crafted XML email attachments, potentially leading to session hijacking, credential theft, or further compromise of the email system.

Affected Products

  • Roundcube Webmail versions before 1.3.12
  • Roundcube Webmail versions 1.4.x before 1.4.5
  • Debian Linux 9.0 and 10.0 (via bundled Roundcube packages)
  • Fedora 31 and 32 (via bundled Roundcube packages)

Discovery Timeline

  • June 2, 2020 - Roundcube releases security patches (versions 1.4.5 and 1.3.12)
  • June 9, 2020 - CVE-2020-13965 published to NVD
  • November 4, 2025 - Last updated in NVD database

Technical Details for CVE-2020-13965

Vulnerability Analysis

This Cross-Site Scripting vulnerability stems from improper handling of XML attachments in Roundcube Webmail's attachment preview functionality. The webmail application allows users to preview attachments directly within the browser interface for convenience. However, the application failed to properly sanitize or restrict the preview rendering of XML content types.

When a user previews an email attachment with the text/xml MIME type, the content is rendered in the browser context. Attackers can embed malicious JavaScript within XML documents using various techniques such as inline event handlers, XML processing instructions, or XSLT stylesheets. Since the preview occurs within the authenticated session context, any executed JavaScript has full access to the user's session, cookies, and the Document Object Model (DOM) of the Roundcube interface.

The vulnerability requires user interaction—specifically, the victim must preview the malicious XML attachment. However, given the routine nature of previewing email attachments, this represents a realistic attack scenario, particularly in targeted phishing campaigns.

Root Cause

The root cause is insufficient input validation and output encoding for XML content types in the attachment preview functionality. Roundcube's allowed MIME types for preview included text/xml without proper sanitization measures to neutralize embedded scripts. The application trusted XML content to be rendered safely, failing to account for the various ways executable code can be embedded within valid XML documents, including embedded SVG with script elements, XSLT transformations, and XML-based event handlers.

Attack Vector

The attack is network-based and requires an attacker to send an email containing a malicious XML attachment to the target user. The exploitation flow consists of:

  1. Attacker crafts an XML file containing embedded JavaScript payloads
  2. Attacker sends the malicious XML as an email attachment to the victim
  3. Victim opens the email in Roundcube Webmail
  4. Victim clicks to preview the XML attachment
  5. Roundcube renders the XML content, executing the embedded JavaScript
  6. Malicious script executes with access to the victim's authenticated session

The vulnerability can be exploited to steal session tokens, capture credentials, modify email content, forward sensitive emails to attacker-controlled addresses, or pivot to attack other users within the same Roundcube deployment.

For detailed technical information about this vulnerability, refer to the GitHub Disclosure for CVE-2020-13965 and the Roundcube Security Advisory.

Detection Methods for CVE-2020-13965

Indicators of Compromise

  • Email attachments with text/xml or application/xml MIME types containing embedded JavaScript, event handlers, or XSLT transformations
  • Unusual session activity following email attachment previews, including unexpected email forwarding rules or settings changes
  • Web server logs showing attachment preview requests followed by anomalous API calls or data exfiltration patterns
  • Browser console errors or unexpected script execution originating from attachment preview frames

Detection Strategies

  • Implement web application firewall (WAF) rules to inspect XML attachments for embedded script elements and event handlers
  • Monitor Roundcube access logs for patterns of attachment preview requests followed by suspicious API activity
  • Deploy browser-based security extensions for users to detect and block inline script execution from untrusted content
  • Use network intrusion detection systems to identify emails with XML attachments containing known XSS payload signatures

Monitoring Recommendations

  • Enable detailed logging for attachment preview functionality to capture user actions and content types accessed
  • Configure alerting for session anomalies such as simultaneous access from different IP addresses or geographic locations
  • Monitor for changes to user email forwarding rules, filters, or account settings that could indicate compromise
  • Implement real-time correlation between attachment access events and subsequent suspicious account activity

How to Mitigate CVE-2020-13965

Immediate Actions Required

  • Upgrade Roundcube Webmail to version 1.4.5 or later (for 1.4.x branch) or version 1.3.12 or later (for 1.3.x branch) immediately
  • Review web server and application logs for evidence of exploitation attempts targeting XML attachment previews
  • Reset sessions for all authenticated users as a precaution if exploitation is suspected
  • Notify users to be cautious of unexpected email attachments, particularly XML files, until patching is complete

Patch Information

Roundcube has released security patches addressing this vulnerability. The fix involves removing text/xml from the allowed MIME types for inline preview or implementing proper sanitization for XML content rendering.

Patch ResourceLink
Security AdvisoryRoundcube Security Updates 1.4.5 and 1.3.12
Patch CommitGitHub Commit 884eb611627ef2bd5a2e20e02009ebb1eceecdc3
Version 1.4.5 ReleaseGitHub Release 1.4.5
Version 1.3.12 ReleaseGitHub Release 1.3.12
Debian Security AdvisoryDSA-4700

Workarounds

  • Disable attachment preview functionality entirely by modifying Roundcube configuration until patching can be completed
  • Configure web server rules to block preview requests for XML MIME types as a temporary measure
  • Implement Content Security Policy (CSP) headers with strict script-src directives to mitigate JavaScript execution from attachment previews
  • Use email filtering to quarantine or strip XML attachments at the mail gateway level pending review
bash
# Example: Disable XML preview in Roundcube config (config/config.inc.php)
# Add or modify the following configuration
$config['client_mimetypes'] = array(
    'text/plain',
    'text/html',
    'image/jpeg',
    'image/gif',
    'image/png',
    'application/pdf'
    # Remove 'text/xml' and 'application/xml' from this list
);

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

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.