← Back to Feed CACHED · 2026-07-07 18:35:44 · CACHE_KEY CVE-2024-42009
CVE-2024-42009 · CWE-79 · Disclosed 2024-08-05

A Cross-Site Scripting vulnerability in Roundcube through 1

ASSESSED — NOISGATE V0.5
Vendor
Reassessed
Verdict:
Do you agree?
01 · The Real Story

A booby-trapped email that hijacks your webmail session the moment you preview it

CVE-2024-42009 is a stored/reflected XSS in Roundcube's message_body() function inside program/actions/mail/show.php. The function fails to properly desanitize certain HTML constructs (notably crafted href animations and SVG attributes) before rendering the message. When a victim simply opens the malicious email in the Roundcube UI, attacker-controlled JavaScript executes in the origin of the webmail, granting full DOM access to the authenticated mailbox. Affected: Roundcube ≤ 1.5.7 and 1.6.x through 1.6.7; fixed in 1.5.8 and 1.6.8.

The vendor's CRITICAL / 9.3 label matches reality — and if anything understates operational risk. Unlike most XSS, delivery is via *email* (bypasses browser SOP concerns), user interaction is a single email open (not a click), and the payload runs inside a session that stores plaintext credentials, 2FA cookies, and every historical message. CISA KEV listed. Sonar disclosed, and CERT.PL has documented Belarus-linked UNC1151 spearphishing chains stealing credentials via this exact bug. Do not treat this as garden-variety XSS.

"KEV-listed, actively weaponized by UNC1151 and China-aligned actors — zero-click email view = full mailbox takeover. Patch now."
02 · The Attack Path

5 steps from start to impact.

STEP 01

Craft the malicious HTML email

Attacker builds an email containing a payload that abuses the desanitization gap in message_body(). Public PoC (0xbassiouny1337/CVE-2024-42009) uses a crafted <a href> with SVG/animate constructs that Roundcube's sanitizer strips outer tags from, leaving executable JS in the DOM. The IceCube payload used in-the-wild goes further — pulling browser-stored credentials, cookies, and 2FA tokens.
Conditions required:
  • Attacker knows a target Roundcube user's email address
  • Target org runs Roundcube ≤ 1.5.7 or 1.6.x ≤ 1.6.7
Where this breaks in practice:
  • None — construction is trivial with public PoC
Detection/coverage: Email gateway HTML-body inspection with signatures for the animate/href pattern; Suricata/Snort community rules exist post-KEV
STEP 02

Deliver via SMTP to the victim

Attacker sends the crafted message using standard SMTP (swaks is the go-to tool per the public walkthrough). Any inbound MX that routes to a vulnerable Roundcube frontend is a viable target. Spearphishing pretext (invoice, meeting invite, government notice) increases the chance of an immediate open.
Conditions required:
  • Ability to deliver mail to victim MX
  • No inbound filter stripping the specific HTML construct
Where this breaks in practice:
  • Aggressive HTML sanitizers at the gateway (Proofpoint, Mimecast, M365 EOP) may neuter the payload before it hits the mailstore
  • SPF/DKIM/DMARC does not help — the payload is in the body, not the envelope
Detection/coverage: Secure email gateway HTML normalization; DMARC alignment for known-good senders won't catch a lookalike domain
STEP 03

Victim opens the message in Roundcube

The moment the user clicks the message in their inbox, Roundcube renders the body via message_body(). The sanitizer bypass fires, the injected JavaScript executes with the origin of the webmail app, and the attacker owns the session context. No further clicks required.
Conditions required:
  • Victim uses the Roundcube web UI (not Thunderbird/Outlook fetching via IMAP)
  • Victim opens the specific message
Where this breaks in practice:
  • Users who only read mail via a desktop IMAP client are unaffected
  • Strict CSP could block inline JS — but Roundcube's default CSP does NOT block this
Detection/coverage: Browser-side JS runtime alerts are noisy and rarely deployed; server-side there is no signal
STEP 04

Session hijack + mailbox exfiltration

The payload uses the victim's authenticated session to call Roundcube's own APIs — dump the inbox, send outbound messages as the victim, and exfiltrate contact lists. The IceCube variant additionally scrapes browser credential store data, session cookies from other origins accessible via extensions, and TOTP seeds where cached. Attacker now has a persistent foothold in the victim's identity.
Conditions required:
  • Payload executed successfully
  • Victim session is authenticated (default state when reading mail)
Where this breaks in practice:
  • MFA does not help — session is already authenticated
  • Short session TTL limits ongoing access but not the initial dump
Detection/coverage: Roundcube access logs will show anomalous message fetch/send rates from the victim's session; SIEM anomaly on message-send velocity is the most reliable signal
STEP 05

Lateral movement via stolen credentials and address book

UNC1151 and the China-aligned cluster reported by TheHackerNews use the stolen credentials to pivot into SSO, VPN, or shared cloud tenants — and use the compromised mailbox to spearphish the victim's contacts with high-trust lures. This is where a webmail XSS becomes an enterprise incident.
Conditions required:
  • Victim reuses password across systems, OR victim has cached tokens exfiltrated by IceCube
Where this breaks in practice:
  • FIDO2/hardware MFA on downstream systems blocks credential reuse
  • Password managers with per-site secrets limit reuse
Detection/coverage: Impossible-travel/new-device signals in IdP; outbound message-send anomalies; DLP on unusual attachment egress
03 · Intelligence Metadata

The supporting signals.

In-the-wild statusActive exploitation confirmed. CERT.PL (June 2025) documented UNC1151 (Belarus/GRU-linked) spearphishing Ukrainian and NATO-aligned targets. TheHackerNews (July 2026) reports a China-aligned cluster hitting universities.
KEV statusListed in CISA KEV — federal remediation deadline enforced
EPSS0.83387 (≈top 1% of all CVEs by predicted exploitation probability)
Public PoC0xbassiouny1337/CVE-2024-42009 on GitHub (weaponized mailbox-exfil script). Sonar published root-cause analysis. Medium walkthrough by Zaid Arif shows end-to-end lab reproduction with swaks.
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:Nnetwork, no auth, low complexity, single-open UI, scope-changed confidentiality+integrity high
Affected versionsRoundcube ≤ 1.5.7 and 1.6.0 – 1.6.7
Fixed versions1.5.8 and 1.6.8. Debian backports: roundcube 1.6.5+dfsg-1+deb12u3 (Bookworm), 1.4.13+dfsg.1-1~deb11u4 (Bullseye). RHEL/EPEL followed within a week.
ExposureShodan shows ~130k–150k internet-facing Roundcube instances; Censys/FOFA confirm heavy deployment in EU academic, gov, and shared-hosting (cPanel) verticals
Disclosure2024-08-05 by Oskar Zeino-Mahmalat @ Sonar (also credited CVE-2024-42008 and CVE-2024-42010 in the same trio)
Payload observedIceCube JS implant — exfiltrates browser-stored passwords, cookies, and 2FA tokens; hooks send-mail API for silent egress
04 · The Call

noisgate verdict.

Final Verdict
= UNCHANGED to CRITICAL (9.3/10)

This is an unauthenticated, network-reachable, single-open-to-detonate XSS in a webmail server whose entire purpose is rendering attacker-supplied HTML — and it is actively weaponized by nation-state actors (UNC1151, China-aligned clusters) and KEV-listed. The decisive factor is the combination of confirmed in-the-wild abuse against real enterprise/government targets and a preauth delivery vector that terminates in full mailbox and credential compromise.

HIGH Exploitation is happening in the wild
HIGH Public working PoC availability
HIGH Vendor patch is available and correct
MEDIUM Enterprise exposure count — depends on how many of your users touch the Roundcube UI vs. fetch mail via IMAP client

Why this verdict

  • KEV + nation-state usage: CISA KEV listing plus documented UNC1151 and China-aligned campaigns collapse any 'wait and see' argument.
  • Preauth delivery, single-open detonation: UI:R is satisfied by the victim merely *opening* the message — not clicking a link, not enabling content. This is functionally zero-click for any user who reads mail.
  • Role multiplier — webmail is an identity boundary: Roundcube sessions terminate in mailbox contents (regulatory data, password-reset links, MFA seed emails) *and* the IceCube payload steals browser cred stores. Blast radius = the victim's entire identity, and via password-reset abuse, downstream SSO tenants. Floor = CRITICAL.
  • Exposure is large: ~130k+ internet-facing instances (Shodan) with heavy concentration in shared hosting (cPanel), academic, and EU government — meaning many enterprise M&A/subsidiary environments run Roundcube even if the mothership uses M365.
  • Patch friction is negligible: upstream fix landed in 1.5.8/1.6.8 nearly two years ago; distro backports are available. No excuse holds up.

Why not higher?

There is no higher bucket than CRITICAL. Score sits at 9.3 rather than 10.0 because impact is bounded at the user/mailbox and downstream identity — there is no direct RCE on the Roundcube host itself, and availability is not directly affected.

Why not lower?

Downgrading to HIGH would require ignoring KEV status, ignoring active nation-state exploitation, and ignoring the fact that a single email view detonates the chain. None of the usual friction levers (needs auth, needs LAN position, narrow version range, low install base) apply here — this is *the* canonical fully-external, fully-weaponized webmail bug.

05 · Compensating Control

What to do — in priority order.

  1. Upgrade Roundcube to 1.6.8 / 1.5.8 or later immediately — This is the only complete fix. Deploy within 3 days per the noisgate mitigation SLA for CRITICAL. On Debian/Ubuntu use the security-repo backport; on cPanel push the vendor RPM (cpanel-roundcubemail ≥ patched build). No config change substitutes for the patch.
  2. Block inbound HTML mail with SVG animate / crafted href constructs at the gateway — As a stopgap while you stage the upgrade, add a Proofpoint/Mimecast/EOP transport rule to quarantine messages containing <svg><animate ...> or href values matching the public PoC signature. Buys you days, not weeks.
  3. Force a global Roundcube session invalidation and password reset for high-value users — Assume compromise for any account that opened untrusted mail between disclosure (Aug 2024) and your patch date. Rotate credentials, revoke OAuth grants, and re-enrol MFA.
  4. Enable and tighten Roundcube's Content-Security-Policy — Set a strict CSP (default-src 'self'; script-src 'self') via reverse-proxy header. Won't fully block the bug on unpatched hosts (Roundcube's own scripts are same-origin) but breaks most out-of-the-box PoCs that rely on inline handlers.
  5. Front Roundcube with a WAF rule inspecting rendered message HTML — Deploy a Modsec/Coraza rule that blocks message-body responses containing the animate/attributeName pattern signature published by Sonar. Deploy within 72 hours.
  6. Alert on abnormal Roundcube send-mail API velocity — The IceCube payload calls the send endpoint at machine speed. A simple SIEM rule (>5 sent messages per session per minute) reliably catches active exfiltration.
What doesn't work
  • MFA on webmail login — the exploit runs *inside* an already-authenticated session; MFA is bypassed by definition.
  • SPF/DKIM/DMARC — the payload lives in the message body, not the envelope; well-aligned mail carries it just as well as spoofed mail.
  • Antivirus attachment scanning — there is no attachment; the payload is inline HTML.
  • User awareness training — 'don't open suspicious email' fails when the user opens *any* email in the vulnerable UI, and legitimate business mail is indistinguishable at the inbox listing.
  • URL rewriting / safe-links — the payload does not depend on a clicked URL; it fires on message render.
06 · Verification

Crowdsourced verification payload.

Run on each Roundcube host as any user (root not required for version detection). Invoke: ./check-cve-2024-42009.sh /var/www/roundcubemail. Pass the Roundcube install root as $1; defaults to /var/www/roundcubemail. Exit code 0 = PATCHED, 1 = VULNERABLE, 2 = UNKNOWN.

noisgate-verify.sh
BASHREAD-ONLYSAFE
#!/usr/bin/env bash
# noisgate check for CVE-2024-42009 (Roundcube XSS)
# Fixed in: 1.5.8, 1.6.8
set -u
ROOT="${1:-/var/www/roundcubemail}"

fail() { echo "UNKNOWN: $1"; exit 2; }

# 1. Locate version
VERSION_FILE="$ROOT/program/include/iniset.php"
INDEX_FILE="$ROOT/index.php"
VERSION=""

if [ -f "$ROOT/program/lib/Roundcube/bootstrap.php" ]; then
  VERSION=$(grep -Eo "RCMAIL_VERSION',\s*'[0-9.]+(-[a-z0-9]+)?" "$ROOT/program/lib/Roundcube/bootstrap.php" 2>/dev/null | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")
fi

if [ -z "$VERSION" ] && [ -f "$INDEX_FILE" ]; then
  VERSION=$(grep -Eo "RCMAIL_VERSION',\s*'[0-9.]+" "$INDEX_FILE" 2>/dev/null | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")
fi

# Debian/RPM package fallback
if [ -z "$VERSION" ]; then
  if command -v dpkg-query >/dev/null 2>&1; then
    VERSION=$(dpkg-query -W -f='${Version}' roundcube-core 2>/dev/null | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+" | head -n1)
  fi
fi
if [ -z "$VERSION" ] && command -v rpm >/dev/null 2>&1; then
  VERSION=$(rpm -q --qf '%{VERSION}\n' roundcubemail 2>/dev/null | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+" | head -n1)
fi

[ -z "$VERSION" ] && fail "could not detect Roundcube version under $ROOT"

echo "Detected Roundcube version: $VERSION"

# 2. Compare against fixed versions
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MINOR=$(echo "$VERSION" | cut -d. -f2)
PATCH=$(echo "$VERSION" | cut -d. -f3)

vulnerable=0
if [ "$MAJOR" -lt 1 ]; then vulnerable=1
elif [ "$MAJOR" -eq 1 ]; then
  if [ "$MINOR" -lt 5 ]; then vulnerable=1
  elif [ "$MINOR" -eq 5 ] && [ "$PATCH" -lt 8 ]; then vulnerable=1
  elif [ "$MINOR" -eq 6 ] && [ "$PATCH" -lt 8 ]; then vulnerable=1
  fi
fi

# 3. Distro backport override — check advisory-note file when patched by distro
if [ $vulnerable -eq 1 ] && command -v dpkg-query >/dev/null 2>&1; then
  PKGVER=$(dpkg-query -W -f='${Version}' roundcube-core 2>/dev/null)
  case "$PKGVER" in
    *deb12u3*|*deb12u4*|*deb12u5*|*deb11u4*|*deb11u5*) vulnerable=0; echo "Debian security backport detected: $PKGVER" ;;
  esac
fi

if [ $vulnerable -eq 1 ]; then
  echo "VULNERABLE: $VERSION is affected by CVE-2024-42009 — upgrade to 1.5.8 / 1.6.8+"
  exit 1
fi

echo "PATCHED: $VERSION is not affected by CVE-2024-42009"
exit 0
07 · Bottom Line

If you remember one thing.

TL;DR
This is a KEV-listed, nation-state-weaponized, single-open-to-detonate webmail RCE-equivalent. Monday morning: (1) inventory every Roundcube instance — including subsidiary, cPanel-shared-hosting, and lab installations; (2) push 1.6.8 / 1.5.8 (or the Debian/EPEL backport) to every host within the noisgate mitigation SLA of ≤ 3 days — because KEV + active exploitation, treat as 'patch/mitigate within hours' rather than 3 days if you haven't already; (3) stand up a Proofpoint/Mimecast/EOP transport rule blocking the SVG-animate/crafted-href pattern as an interim compensating control while you stage rollout; (4) audit Roundcube send-mail logs since August 2024 for anomalous outbound volume and rotate credentials + revoke sessions for any user whose mailbox opened untrusted mail; (5) full remediation — every instance on the fixed branch, EOL 1.4.x retired — completes within the noisgate remediation SLA of ≤ 90 days.

Sources

  1. NVD — CVE-2024-42009
  2. Sonar root-cause writeup
  3. CERT.PL — UNC1151 Roundcube campaign
  4. TheHackerNews — China-aligned exploitation of Roundcube
  5. HelpNetSecurity coverage
  6. GitHub PoC — 0xbassiouny1337/CVE-2024-42009
  7. Snyk advisory (Debian package view)
  8. SentinelOne vulnerability database entry
Peer Review

What defenders are saying.

Submit a review attribution: handle + country only
0 flags selected · stored anonymously
Validation Results

Crowdsourced verification outputs.

Results submitted by users who ran the verification payload against their environment.