CVE-2024-42009 — RoundCube Webmail Cross-Site Scripting Vulnerability

CVE-2024-42009

Roundcube Webmail — XSS via Desanitized message_body(); APT Email Surveillance; Fixed in 1.5.8 and 1.6.8

What is Roundcube Webmail?

Roundcube is one of the most widely deployed open-source web-based email clients, used by internet service providers, universities, governments, and enterprises globally. It processes and renders HTML email content in the browser — making its HTML sanitization a critical security boundary. Any bypass of sanitization allows email senders to inject JavaScript that executes in the victim's browser context, enabling email account takeover and session theft. Roundcube has a long history of XSS exploitation by sophisticated threat actors including APT28 and Winter Vivern.

See also CVE-2025-68461 (December 2025 Roundcube XSS via SVG animate tag) for a later vulnerability in the same product.

Overview

CVE-2024-42009 is a cross-site scripting vulnerability (CWE-79) in Roundcube Webmail triggered through a desanitization issue in the message_body() function in program/actions/mail/show.php. An attacker can craft a malicious email that, when opened in Roundcube, executes JavaScript in the victim's browser — enabling them to steal email contents, session cookies, and send emails on behalf of the victim. The Changed scope (S:C) and High confidentiality/integrity impacts reflect that the XSS breaks out of the normal same-origin context to affect the victim's full email account. CISA added it to the KEV catalog 10 months after the patch, indicating sustained exploitation of unpatched instances throughout this period.

Affected Versions

Branch Vulnerable Fixed
Roundcube 1.6.x < 1.6.8 1.6.8
Roundcube 1.5.x < 1.5.8 1.5.8

Technical Details

The XSS (CWE-79) is a desanitization issue in Roundcube's message_body() function — the code responsible for rendering HTML email bodies. When Roundcube processes a specially crafted HTML email, a specific combination of HTML attributes or tags causes the sanitizer to incorrectly re-introduce malicious content that should have been stripped. The attacker embeds JavaScript in the email body in a way that survives the sanitization pass.

When the victim opens the email in Roundcube, the injected JavaScript executes in the browser:

  • Reads email data: accesses other emails, contacts, and account settings via Roundcube's AJAX API
  • Steals session cookies (if not HttpOnly) enabling account takeover
  • Sends exfiltration requests: forwards email contents to attacker-controlled servers
  • Sends emails as the victim: enables phishing or business email compromise from the victim's account

The attack requires only that the victim open the email — zero additional clicks. An attacker sends the crafted email, waits for the target to open it in Roundcube, and collects the exfiltrated data.

Discovery

Not publicly attributed for the initial discovery. The 10-month gap before KEV listing reflects ongoing APT exploitation — likely by state-sponsored actors who prefer to quietly exploit vulnerabilities before they become widely patched.

Exploitation Context

CISA confirmed active exploitation and added to the KEV catalog on June 9, 2025 — 10 months after the August 2024 patch. Roundcube's history of state-sponsored exploitation (APT28 used a Roundcube XSS zero-day in 2023 for diplomatic email surveillance; Winter Vivern targeted European government Roundcube instances) suggests this vulnerability was used in targeted surveillance campaigns during the unpatched period.

The CVSS 9.3 "CRITICAL" rating for an XSS reflects the real-world impact of email surveillance: access to confidential communications, credential theft, and the ability to send emails as the victim for business email compromise.

Remediation

  1. Upgrade Roundcube to 1.6.8 or 1.5.8 immediately. The CISA deadline was June 30, 2025.
  2. Apply the December 2025 companion patch for CVE-2025-68461 (SVG animate tag XSS) — both target Roundcube's HTML sanitization; upgrade to 1.6.12+/1.5.12+ to address both.
  3. Enable HttpOnly on session cookies in Roundcube's configuration — this prevents JavaScript from reading the session cookie even if XSS fires, limiting the attack to same-session impact.
  4. Implement Content Security Policy (CSP) headers to restrict inline JavaScript execution in the Roundcube web application.
  5. Audit inbound email logs for messages from unknown senders with complex HTML bodies sent to high-value accounts during the August 2024–June 2025 exposure window.

Key Details

PropertyValue
CVE ID CVE-2024-42009
Vendor / Product Roundcube — Webmail
NVD Published2024-08-05
NVD Last Modified2025-11-04
CVSS 3.1 Score9.3
CVSS 3.1 VectorCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
SeverityCRITICAL
CWE CWE-79 find similar ↗
CISA KEV Added2025-06-09
CISA KEV Deadline2025-06-30
Known Ransomware Use No

CVSS 3.1 Breakdown

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None

Required Action

CISA BOD 22-01 Deadline: 2025-06-30. Apply mitigations per vendor instructions, follow applicable BOD 22-01 guidance for cloud services, or discontinue use of the product if mitigations are unavailable.

Timeline

DateEvent
2024-08-04Roundcube 1.6.8 and 1.5.8 released with fix
2024-08-05CVE published
2025-06-09CISA adds to KEV (10-month delay — confirmed exploitation over extended period)
2025-06-30CISA BOD 22-01 remediation deadline

References

ResourceType
Roundcube Security Updates 1.6.8 and 1.5.8 Vendor Advisory
NVD — CVE-2024-42009 Vulnerability Database
CISA KEV Catalog Entry US Government