Summary
Roundcube Webmail 1.6.x between 1.6.14 and 1.6.16, and 1.7.x before 1.7.1, contains insufficient sanitization of CSS in HTML email content, allowing external stylesheet references to untrusted locations.
When stylesheet links can point to internal or sensitive network endpoints, this behavior may be abused for server-side request forgery (SSRF) or information disclosure via the Roundcube server.
Affected context
The vulnerability exists in Roundcube Webmail's HTML email rendering pipeline when displaying messages that contain CSS, including external stylesheet references.
It becomes relevant where:
- HTML email rendering is enabled and used by users
- CSS and
<link rel="stylesheet">or similar constructs are not fully sanitized - The Roundcube server has network connectivity to internal services or metadata endpoints that are not directly exposed to email senders
Deployments with broader internal network access from the webmail server are more exposed to SSRF-style abuse.
Exploit preconditions
- Attack surface: HTML email rendering in Roundcube Webmail.
- Required access: Ability to send or relay HTML emails to users whose messages are rendered by the vulnerable Roundcube instance (typically any authenticated mail sender or external email source, depending on mail gateway configuration).
- Trigger point: A user opens or previews a crafted HTML email, causing Roundcube to process embedded CSS and external stylesheet references.
- Why exploitation is possible: CSS sanitization is incomplete, allowing stylesheet URLs that can cause the Roundcube server to initiate HTTP/HTTPS requests to attacker-chosen targets, including internal hosts, leading to SSRF or indirect exposure of response-dependent information.
Why this happens
This issue is an instance of CWE-918: Server-Side Request Forgery, where a server component is tricked into making network requests to attacker-selected endpoints.
Roundcube's HTML sanitization logic for CSS did not sufficiently restrict which URLs could be referenced from stylesheets in incoming email content.
As a result, external stylesheet links in email could still reference internal or sensitive network locations.
Because the webmail server, not the end-user's browser, performs or mediates these requests, an external attacker can leverage the server's network position to probe internal services or cause information to be disclosed through side channels such as load timing, error messages, or resource-dependent rendering.
Potential impact
- The Roundcube server may issue HTTP/HTTPS requests to internal network services controlled only by internal administrators.
- Attackers could use the server as a pivot to scan internal IP ranges and identify live hosts or open ports.
- Certain responses or behaviors could leak information about internal endpoints (e.g., existence of services, resource sizes, or error states).
- In some deployment scenarios, the server might access cloud metadata endpoints or administrative interfaces, potentially exposing configuration or token data if additional weaknesses exist.
- Increased risk of chaining with other vulnerabilities (e.g., misconfigured internal services) for deeper compromise.
General mitigation guidance
Mitigation generally focuses on tightening HTML and CSS sanitization and constraining the server's network capabilities:
- Enforce strict allowlists for URL schemes and domains in all CSS and HTML attributes that can load remote resources, blocking access to internal IP ranges, loopback addresses, and link-local or metadata hosts.
- Normalize and canonicalize URLs before applying filters to avoid bypasses via obfuscation (e.g., encoded IPs, mixed schemes, or redirects).
- Consider disabling or heavily restricting external resource loading from email content, favoring inline-safe styles or a predefined stylesheet set.
- Reduce the Roundcube server's network reach by segmenting it from sensitive internal services and metadata endpoints, and applying egress firewall rules where possible.
- Apply defense-in-depth by running the webmail application with least-privilege network and OS permissions so that any SSRF impact is bounded.
How teams detect issues like this
Detection can be approached at both the code and operational levels:
- Static analysis and code review: Look for HTML and CSS sanitization routines that:
- Allow arbitrary URL targets in style or link tags
- Lack checks against private IP ranges and loopback addresses
- Fail to normalize URLs before validation
- Security testing: Use application-level scanning to send crafted HTML emails with external stylesheet references targeting:
- Internal IP ranges (e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16)
- Loopback addresses (127.0.0.0/8, ::1)
- Cloud metadata endpoints
and monitor whether the server initiates outgoing requests.
- Network and log monitoring: Inspect outbound HTTP/HTTPS traffic from the Roundcube server for unusual destinations or patterns aligned with email reception and viewing.
- Automated review tools: Integrate web application security scanners and linters that include SSRF-oriented checks for server-side resource fetching and URL handling.

