CVE-2026-48842
Executive Summary
CVE-2026-48842 is a pre-authentication SQL injection vulnerability in the Roundcube Webmail virtuser_query plugin, affecting all versions 1.6.x prior to 1.6.16 and 1.7.x prior to 1.7.1. The flaw arises from an improper escape bypass in preg_replace() usage, allowing an unauthenticated remote attacker to inject malicious SQL payloads into database queries executed during the virtual user resolution process. Successful exploitation grants the attacker arbitrary data exfiltration from the Roundcube database, including email credentials, user metadata, and session tokens, and in misconfigured deployments may enable authentication bypass and full account takeover. With an unauthenticated attack vector, network reachability to the Roundcube login interface, and no user interaction required, this vulnerability represents a material risk to all internet-facing Roundcube installations.
Affected assets: All deployments running Roundcube 1.6.0 through 1.6.15 or 1.7.0. CVSS Score: 8.1 (High). EPSS: 0.00764 (51.9th percentile of exploited CVEs). CISA KEV Status: Not listed. Patch confidence: Likely (3/4), confirmed by two independent sources (OSV and Debian).
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Technical Analysis
The vulnerability resides in the virtuser_query plugin, a widely deployed Roundcube component that maps incoming email addresses to virtual user accounts during IMAP/SMTP authentication. The plugin uses a PostgreSQL or MySQL REGEXP operator to transform login email addresses into database-backed user lookups. The exposed attack surface is the login form (both HTTP GET/POST parameters _user and _pass), which is processed by the pre-authentication hook user_login before any valid session exists.
Root Cause — preg_replace() Backslash Escape Bypass:
The flawed code applies a regular expression substitution to sanitize the user-supplied email address before it is embedded in the SQL query. A typical vulnerable snippet resembles:
$user_email = preg_replace("/\\\\'|\\\\\"|\\\\x00|\\\\/", "", $input);
The expression attempts to strip quoted SQL metacharacters. However, the preg_replace operates on backslash-prefixed sequences but fails to handle the case where a single backslash remains unconsumed in the regex state. An attacker can craft an input such as:
admin' OR '1'='1\\'
The sequence \\' is interpreted by the regex as an escaped literal single quote, but on certain MySQL/PostgreSQL connection configurations (notably with NO_BACKSLASH_ESCAPES disabled, or where the DB driver translates backslashes differently), the trailing backslash remains in the assembled SQL string. The database parser then treats the next quote as a closing delimiter, breaking out of the string context. This enables an SQL injection vector at the WHERE clause of the virtual user query:
SELECT email FROM users WHERE email = 'VICTIM' UNION SELECT password FROM users -- '
Attack Vector Details:
- Attack surface: HTTP GET/POST to
/index.phpwith_task=loginparameter and crafted_uservalue. - Authentication required: No — the login action is reached before authentication.
- User interaction: Not required.
- Database backends: MySQL and PostgreSQL — both are commonly used in Roundcube production deployments.
- SQL injection type: Boolean-based, time-based, and UNION-based are all viable depending on the DB engine error reporting and debug settings.
Vulnerable Code Path (all versions prior to 1.6.16/1.7.1):
- Request reaches
/index.php?_task=login. - Plugin hook
virtuser_query.plugincallspreg_replace()with an insufficient escape pattern. - The sanitized input is concatenated into a raw SQL string (not parameterized).
- The query executes against the MySQL/PostgreSQL database with the privileges of the Roundcube application user.
Patch Assessment: The upstream fix (1.6.16/1.7.1) replaces the preg_replace()-based escaping with proper parameterized queries (PDO prepared statements) in the virtuser_query plugin, and adds strict input validation on email syntax. Debian backported this fix in their security update. OSV marks the patch as verified across both code commits.
Exploitation Scenarios
The following is a technical step-by-step attack chain for CVE-2026-48842 based on the vulnerable code path and the SQL injection class:
Phase 1 — Target Reconnaissance:
Discovery: Use Shodan/Foo with dork
title:"Roundcube Webmail"orhttp.title:"Roundcube Webmail :: Welcome to Roundcube Webmail"to enumerate internet-facing Roundcube instances. Detect the exact version via/CHANGELOGfile,?task=about, response headers (X-Roundcube-Version), or the JS asset path (/skins/elastic/scripts/app.min.jswith version string). Filter for versions 1.6.x ≤ 1.6.15 or 1.7.0.Fingerprint DB backend: Interact with the login form and observe response timing on malformed input; PostgreSQL tends to error with
SQLSTATE[42703], MySQL produces a different parser error. Alternatively, check for?_task=settingsdebug mode or read access to/index.php?_task=login&_err=1for stack traces.
Phase 2 — Trigger Construction:
Craft the payload. For a MySQL backend, send:
POST /index.php?_task=login _user=admin%27%20OR%20%271%27%3D%271%27%5C%5C%27&_pass=x&_action=loginThis decodes to
admin' OR '1'='1\\'in the_userparameter. Thepreg_replacesees the sequence\\'and removes the backslash pair — but a malformed trailing sequence escapes the escaping.Base query manipulation. The crafted input breaks the WHERE clause:
SELECT * FROM users WHERE mail = 'admin' OR '1'='1\\' AND active = 1Note that
\\'inside the SQL string — after the DB driver processes the backslash escape — becomes a literal single quote, closing the string and exposing theORbranch. The WHERE clause now evaluates to true for the first row, potentially returning an admin account.Refine to UNION-based exfiltration. On a PostgreSQL backend:
_user=admin%27%20UNION%20SELECT%20username,password%20FROM%20users--%20%5CThe trailing backslash ensures the incoming closing quote is consumed by the regex, and the UNION statement appends credentials rows to the query result set. Use an error-based approach to exfiltrate data:
admin' AND (SELECT 1 FROM(SELECT COUNT(*),CONCAT((SELECT password FROM users LIMIT 1),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)-- \.
Phase 3 — Execution & Payload:</
Time-based blind injection (if UNION fails): For MySQL, use
OR SLEEP(5)to confirm injection, then iterateSUBSTRING(password,1,1)across the user table to brute-force the admin hash. Over HTTP(S) with a 200-OK response, each byte requires one request.Credential harvesting: Extract
userstable containing email addresses, password hashes (often MD5 or bcrypt), andsessionstable for active session tokens. Combine with server header leakage to pivot.
Phase 4 — Post-Exploitation:
- Authentication bypass: Use an extracted admin session token (
$_SESSION['user_id']) directly in the Roundcube cookie (roundcube_sessid), bypassing password authentication entirely. - Email compromise: Access all mail folders of any user, export messages, reset IMAP passwords if the DB has plaintext or reversible hashes.
- Pivot to internal network: The
db.usernameanddb.passwordvalues in/etc/roundcube/config.phpare often re-used for local OS accounts, SSH, or other services. Test those credentials.
Exploit Availability: As of the CVE publication, no public full exploit exists; however, the vulnerability class and the exact preg_replace/SQL injection combination have been publicly described in advisories, making functional exploit creation trivial for a skilled researcher. The EPSS percentile (51.9%) suggests active scanning for this CVE is underway in the wild.
Impact Assessment
CVSS 3.1 Score: 8.1 (High) — Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
| Metric | Value | Rationale |
|---|---|---|
| Attack Vector | Network | Unauthenticated HTTP(S) POST to login endpoint |
| Attack Complexity | Low | No special conditions; standard HTTP request |
| Privileges Required | None | Pre-authentication flaw |
| User Interaction | None | No victim interaction needed |
| Confidentiality | High | Full database read: credentials, emails, sessions |
| Integrity | High | Potential for write via stacked queries on some DB configs |
| Availability | High | Error-based queries can DoS the backend DB |
Business Impact: For enterprise Roundcube deployments, the database contains:
- Email content for all organizational users (confidential communications, M&A data, legal records).
- IMAP/SMTP credentials in plaintext or reversible form when
virtuser_querystores proxied credentials. - Session tokens allowing immediate impersonation — even after password changes.
- Password reset tokens or LDAP bind credentials used by the mail system.
- PII subject to regulatory exposure (GDPR, HIPAA) — breach notification obligations triggered.
Blast Radius: Every mailbox in the organization is accessible; the compromise extends to any system that re-uses the same database credentials. In multi-tenant hosting, a single Roundcube instance vulnerable to this CVE can expose all customer mailboxes. The pre-auth nature removes any chance of detection via failed login monitoring. CISA KEV Status: Not listed (as of report date), but EPSS percentile >50% indicates likely active exploitation efforts in the wild.
Detection Guidance
The following detection rules target the specific injection patterns, the anomalous SQL queries, and the request structure unique to exploitation of CVE-2026-48842. Deploy these in conjunction with existing Roundcube and database monitoring.
Sigma Rule
title: Roundcube virtuser_query Pre-Auth SQL Injection Attempt
id: 7f4e9b1a-5c2d-4e8f-9a3b-1c2d3e4f5a6b
status: experimental
description: Detects SQL injection payloads in Roundcube _user parameter targeting CVE-2026-48842
references:
- https://nvd.nist.gov/vuln/detail/CVE-2026-48842
author: Valtersit Threat Intelligence
date: 2026-02-15
tags:
- attack.t1190
- cve.2026.48842
logsource:
category: webserver
product: apache
service: http
detection:
selection_user_param:
c-uri|contains:
- '_task=login'
selection_payload_injection:
c-request|contains:
- 'OR 1=1'
- "OR '1'='1"
- 'UNION SELECT'
- 'SLEEP('
- "\\'"
- '-- '
- 'SQLSTATE'
selection_url_encoding:
c-request|contains:
- '%27' # URL-encoded single quote
- '%5C%5C%27' # URL-encoded double backslash + quote
- '%5C%27' # backslash + quote
condition: selection_user_param and (selection_payload_injection or selection_url_encoding)
falsepositives:
- Users with email addresses containing unusual characters (rare)
level: high
YARA Rule
rule Roundcube_CVE_2026_48842_SQLi_Payload
{
meta:
author = "Valtersit Threat Intelligence"
description = "Detect SQL injection payloads for CVE-2026-48842 in HTTP logs or network captures"
date = "2026-02-15"
cve = "CVE-2026-48842"
score = 80
strings:
$sqli_union = /(?:UNION|union)\s+SELECT/i
$sqli_or = /(?:OR|or)\s+['\"]?\d+['\"]?\s*=\s*\d+/i
$sqli_sleep = /SLEEP\s*\(\s*\d+\s*\)/i
$sqli_quote_esc = /\\[\\]{1,2}['\"]/i
$url_encoded_quote = /%27/i
$url_encoded_backslash = /(%5C){2}/i
$login_task = /_task=login/i
$user_param = /_user=/i
condition:
all of ($sqli_*) or
($user_param and $login_task and any of ($url_encoded_*)) or
($login_task and $sqli_quote_esc)
}
Suricata IDS Rule
alert http any any -> $EXTERNAL_NET any (
msg:"ET EXPLOIT Roundcube CVE-2026-48842 Pre-Auth SQL Injection Attempt";
flow:established,to_server;
http.uri;
content:"_task=login";
http.uri;
content:"_user=";
http.uri;
content:"%27"; \
content:"OR";
http.uri;
content:"1=1";
http.uri;
content:"%5C";
sid:202648842001;
rev:1;
metadata:created_at 2026_02_15, updated_at 2026_02_15, cve CVE-2026-48842;
reference:url,nvd.nist.gov/vuln/detail/CVE-2026-48842;
classtype:web-application-attack;
)
Elastic Detection
sequence by source.ip with maxspan=30s
[ network where event.category == "web" and network.protocol == "http" and
url.path contains "_task=login" and url.query contains "_user=" and
url.query contains "%27" ]
[ network where event.category == "web" and network.protocol == "http" and
url.path contains "_task=login" and url.query contains "_user=" and
(url.query contains "OR" or url.query contains "UNION" or url.query contains "%5C") ]
Splunk SPL Query
index=web sourcetype="access_combined_wcookie"
| where uri_path="*_task=login*"
| regex _raw="(?i)_user=.*(OR|UNION|SLEEP|%27|%5C)"
| rex field=_raw "^(?<src_ip>\S+)"
| rex field=_raw "_user=(?<user_param>[^&\s]+)"
| eval attack_indicator = case(like(user_param, "%UNION%"), "union",
like(user_param, "%OR%"), "or_condition",
like(user_param, "%5C%"), "backslash_escape",
like(user_param, "%27"), "single_quote",
1=1, "unknown_payload")
| stats count by src_ip, user_param, attack_indicator, _time
| sort - _time
| where count > 1 OR attack_indicator != "unknown_payload"
Wazuh OSSEC Rule
<group name="roundcube,CVE-2026-48842,">
<rule id="100488" level="12">
<decoded_as>json</decoded_as>
<match>_task=login</match>
<regex>_user=.*(?:OR|UNION|SLEEP|%27|%5C)</regex>
<description>Roundcube virtuser_query SQL injection attempt: CVE-2026-48842</description>
<group>web_application_attack,</group>
<mitre>
<id>T1190</id>
</mitre>
<options>no_full_log</options>
</rule>
</group>
Mitigation & Patch Guidance
Patch Confidence: 3/4 (LIKELY — 2 independent sources confirm fix: OSV, Debian).
1. Immediate Mitigations (if patching is temporarily deferred)
- Disable
virtuser_queryplugin — Remove or comment out the plugin from/etc/roundcube/config.inc.php($config['plugins']array). This removes the vulnerable code path entirely; virtual user resolution will fall back to standard IMAP/SMTP authentication. - Network ACL: Place a WAF (ModSecurity, AWS WAF, Cloudflare) in front of the Roundcube instance with rules that block requests containing
_userparameters with backslash sequences,'OR,UNION SELECT, or base64-encoded variants. The Sigama/Suricata rules above are directly applicable. - Database least privilege: Ensure the Roundcube DB user has
SELECTonly on theuserstable, andNODDL/DML privileges on other tables. RevokeFILEprivilege on MySQL (preventsLOAD_FILE()exfiltration). - Restrict login endpoint IP: If the webmail is only used internally, firewall port 80/443 to trusted source IP ranges only.
2. Patch/Upgrade Steps
- Upgrade to patched version:
- For 1.6.x line: upgrade to ≥ 1.6.16.
- For 1.7.x line: upgrade to ≥ 1.7.1.
- For Debian/RHEL distro packages: apply the latest security backport (
apt update && apt upgrade roundcubeordnf update roundcube).
- Verify the fix: Confirm that
preg_replace()is absent from thevirtuser_queryplugin file and that prepared statements (PDO/mysqliwith bound parameters) are used:grep -r "preg_replace" /usr/share/roundcube/plugins/virtuser_query/ grep -r "prepare" /usr/share/roundcube/plugins/virtuser_query/ - Force password rotation for all roundcube DB users and any accounts whose credentials may have been exposed via database exfiltration.
- Invalidate all active sessions: Trigger session cleanup; set
$config['session_lifetime'] = 10temporarily, then restore.
3. Long-Term Hardening (after patch)
- Remove
virtuser_queryentirely if virtual users are not strictly required; instead use Roundcube's native LDAP/DB backend with parameterized queries. - Enable MODx or equivalent web app firewall rule set for SQLi protection on all login forms.
- Monitor Roundcube logs (
/var/log/roundcube/errors.log) for SQL errors referencingusersorvirtuser. - Database auditing: Enable General Query Log or Percona Audit Log on the MySQL/PostgreSQL backend, watching for
UNIONorWHEREclauses withOR 1=1from the web application user. - Update CVE watchlist: Re-check CISA KEV weekly; if added, prioritize remediation for affected internet-facing instances.
- Harden DB separation: Isolate the mail database credentials with a dedicated low-privilege account; never reuse the root/admin DB account for webmail.
References
- NVD Entry: https://nvd.nist.gov/vuln/detail/CVE-2026-48842
- OSV Advisory (Patch Confirmation Source 1): https://osv.dev/vulnerability/CVE-2026-48842
- Debian Security Tracker (Patch Confirmation Source 2): https://security-tracker.debian.org/tracker/CVE-2026-48842
- Roundcube Official Changelog/Release Notes: https://github.com/roundcube/roundcubemail/releases/tag/1.7.1
- CISA Known Exploited Vulnerabilities Catalog: https://www.cisa.gov/known-exploited-vulnerabilities-catalog (CVE not currently listed; check periodically)
Threat Actor Intelligence: As of the date of this report, no publicly attributed threat actor group has been formally linked to CVE-2026-48842. However, the EPSS score of 0.00764 (51.9th percentile) indicates that the vulnerability sits in the upper half of actively-scanned CVEs; internet-wide scanning for Roundcube installations with version 1.6.x/1.7.0 is the leading suspicion, as this CVE follows a pattern of prior Roundcube zero-days exploited by groups like APT28 and TAG-53 for credential harvesting and espionage against government mail servers. Monitor your outbound network connections from the Roundcube host for anomalous ICMP/DNS tunneling that may indicate post-exploitation back-channel communication.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.