Roundcube Webmail Critical Security Vulnerability Report

Date: 2025-06-13
Severity: CRITICAL
CVSS Score: 9.8 (Critical)
Attack Vector: Network
Attack Complexity: Low
Privileges Required: Low (authenticated user)
User Interaction: None
Impact: Remote Code Execution
Reported: No. We have not had any luck getting package maintainers to look into "potential" vulnerabilities unless we can provide a current proof of concept. As most of what we patch does not have a POC at the time we patch, we ceased attempting to report and just patch it ourselves to future-proof.

Executive Summary

A critical remote code execution vulnerability was discovered in Roundcube Webmail affecting the eval_expression() method in roundcube/program/include/rcmail_output_html.php. The vulnerability allows authenticated users to execute arbitrary PHP code on the server through template injection attacks.

Vulnerability Details

Root Cause

The eval_expression() method (line 1266) uses PHP's eval() function to process user-controllable template expressions without proper validation:

return eval("return ($expression);");

Attack Surface

Attack Mechanism

The vulnerability can be exploited when user-controlled data is processed through Roundcube's template system:

  1. Input Vector: User-controllable data reaches template processing
  2. Template Injection: Malicious template expressions are injected
  3. Expression Evaluation: eval_expression() processes the malicious input
  4. Code Execution: eval() executes arbitrary PHP code

Example Exploit:

Template Expression: "><roundcube:if condition="system('id')">
Result: Remote command execution as web server user

Impact

Technical Impact Possible

Remediation

Immediate Actions Taken

Core Vulnerability Fix

File: roundcube/program/include/rcmail_output_html.php

Implemented comprehensive validation system:

Security Validation Implementation Details

Blacklist (Always Blocked):

Allowed Elements:

Validation Benefits:

  1. Security: Comprehensive blocking of dangerous functions
  2. Usability: Allows legitimate Roundcube template expressions
  3. Flexibility: Easy to extend safe function list
  4. Maintenance: Clear separation of concerns

Timeline

Contact

security@codamail.com

References


Report Generated: 2025-06-13
Status: RESOLVED - Comprehensive security validation implemented