Low severity3.1NVD Advisory· Published Apr 3, 2026· Updated Apr 7, 2026
CVE-2026-35538
CVE-2026-35538
Description
An issue was discovered in Roundcube Webmail before 1.5.14 and 1.6.14. Unsanitized IMAP SEARCH command arguments could lead to IMAP injection or CSRF bypass during mail search.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
roundcube/roundcubemailPackagist | >= 1.7-beta, < 1.7-rc5 | 1.7-rc5 |
Affected products
1Patches
37daf5aa9c190Fix IMAP Injection + CSRF bypass in mail search
3 files changed · +8 −0
CHANGELOG.md+1 −0 modified@@ -4,6 +4,7 @@ - Security: Fix pre-auth arbitrary file write via unsafe deserialization in redis/memcache session handler - Security: Fix bug where a password could get changed without providing the old password +- Security: Fix IMAP Injection + CSRF bypass in mail search ## Release 1.5.13
program/actions/mail/search.php+4 −0 modified@@ -71,6 +71,10 @@ public function run($args = []) $sort_column = self::sort_column(); $sort_order = self::sort_order(); + // We pass the filter as-is into IMAP SEARCH command. A newline could be used + // to inject extra commands, so we remove these. + $search_str = preg_replace('/[\r\n]+/', ' ', $search_str); + // set message set for already stored (but incomplete) search request if (!empty($continue) && isset($_SESSION['search']) && $_SESSION['search_request'] == $continue) { $rcmail->storage->set_search_set($_SESSION['search']);
program/actions/mail/send.php+3 −0 modified@@ -280,6 +280,9 @@ public function run($args = []) } if ($savedraft) { + // Sanitize the IMAP SEARCH input + $message_id = preg_replace('/[\r\n]+/', '', $message_id); + // remember new draft-uid ($saved could be an UID or true/false here) if ($saved && is_bool($saved)) { $index = $rcmail->storage->search_once($drafts_mbox, 'HEADER Message-ID ' . $message_id);
b18a8fa8e815Fix IMAP Injection + CSRF bypass in mail search
3 files changed · +8 −0
CHANGELOG.md+1 −0 modified@@ -5,6 +5,7 @@ - Fix Postgres connection using IPv6 address (#10104) - Security: Fix pre-auth arbitrary file write via unsafe deserialization in redis/memcache session handler - Security: Fix bug where a password could get changed without providing the old password +- Security: Fix IMAP Injection + CSRF bypass in mail search ## Release 1.6.13
program/actions/mail/search.php+4 −0 modified@@ -71,6 +71,10 @@ public function run($args = []) $sort_column = self::sort_column(); $sort_order = self::sort_order(); + // We pass the filter as-is into IMAP SEARCH command. A newline could be used + // to inject extra commands, so we remove these. + $search_str = preg_replace('/[\r\n]+/', ' ', $search_str); + // set message set for already stored (but incomplete) search request if (!empty($continue) && isset($_SESSION['search']) && $_SESSION['search_request'] == $continue) { $rcmail->storage->set_search_set($_SESSION['search']);
program/actions/mail/send.php+3 −0 modified@@ -281,6 +281,9 @@ public function run($args = []) } if ($savedraft) { + // Sanitize the IMAP SEARCH input + $message_id = preg_replace('/[\r\n]+/', '', $message_id); + // remember new draft-uid ($saved could be an UID or true/false here) if ($saved && is_bool($saved)) { $index = $rcmail->storage->search_once($drafts_mbox, 'HEADER Message-ID ' . $message_id);
5fe8a69956a9Fix IMAP Injection + CSRF bypass in mail search
3 files changed · +8 −0
CHANGELOG.md+1 −0 modified@@ -11,6 +11,7 @@ This file includes only changes we consider noteworthy for users, admins and plu - Fix bug where `rel=stylesheet` part of a `<link>` could get removed - Security: Fix pre-auth arbitrary file write via unsafe deserialization in redis/memcache session handler - Security: Fix bug where a password could get changed without providing the old password +- Security: Fix IMAP Injection + CSRF bypass in mail search ## 1.7-rc4
program/actions/mail/search.php+4 −0 modified@@ -217,6 +217,10 @@ public static function search_input($str, $headers = '', $filter = 'ALL', $inter // Add list filter string $result = $filter && $filter != 'ALL' ? $filter : ''; + // We pass the filter as-is into IMAP SEARCH command. A newline could be used + // to inject extra commands, so we remove these. Keep the filter simple, please. + $result = preg_replace('/[\r\n]+/', ' ', $result); + // Add the interval filter string if ($search_interval = self::search_interval_criteria($interval)) { $result .= ' ' . $search_interval;
program/actions/mail/send.php+3 −0 modified@@ -246,6 +246,9 @@ public function run($args = []) } if ($savedraft) { + // Sanitize the IMAP SEARCH input + $message_id = preg_replace('/[\r\n]+/', '', $message_id); + // remember new draft-uid ($saved could be an UID or true/false here) if ($saved && is_bool($saved)) { $index = $rcmail->storage->search_once($drafts_mbox, 'HEADER Message-ID ' . $message_id);
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
9- github.com/roundcube/roundcubemail/commit/5fe8a69956a9683a4269f3ad2a68e18deebf8a15nvdPatchWEB
- github.com/roundcube/roundcubemail/commit/7daf5aa9c190ccc75bb31672d8fee9938877fd64nvdPatchWEB
- github.com/roundcube/roundcubemail/commit/b18a8fa8e81571914c0ff55d4e20edb459c6952cnvdPatchWEB
- github.com/advisories/GHSA-8jr8-v43g-5c57ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2026-35538ghsaADVISORY
- roundcube.net/news/2026/03/18/security-updates-1.7-rc5-1.6.14-1.5.14nvdVendor AdvisoryWEB
- github.com/roundcube/roundcubemail/releases/tag/1.5.14nvdRelease NotesWEB
- github.com/roundcube/roundcubemail/releases/tag/1.6.14nvdRelease NotesWEB
- github.com/roundcube/roundcubemail/releases/tag/1.7-rc5nvdRelease NotesWEB
News mentions
0No linked articles in our index yet.