CVE-2026-45016: EGroupware Vulnerable to Local File Inclusion via file:// URI in Mail Compose
Summary The function processes image URLs embedded in an HTML email body without validating or restricting URI schemes. The check !strstartswith($myUrl, 'http') evaluates to true for file:// URIs, causing filegetcontents($basedir . urldecode($myUrl)) to read arbitrary files from the server filesystem and embed them as inline MIME attachments in outgoing email.
Published Jul 7, 2026
Affected packages
egroupware/egroupware
- Ecosystem
- Composer (PHP)
- Affected
- >= 26.0.20251208, < 26.5.20260507
- Fixed in
- 26.5.20260507
- Check
composer show egroupware/egroupware
egroupware/egroupware
- Ecosystem
- Composer (PHP)
- Affected
- < 23.1.20260601
- Fixed in
- 23.1.20260601
- Check
composer show egroupware/egroupware
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
The function processes image URLs embedded in an HTML email body without validating or restricting URI schemes. The check !str_starts_with($myUrl, 'http') evaluates to true for file:// URIs, causing file_get_contents($basedir . urldecode($myUrl)) to read arbitrary files from the server filesystem and embed them as inline MIME attachments in outgoing email.
str_starts_with('file:///etc/passwd', 'http') → false !false → true
// api/src/Mail.php
foreach($images[2] as $i => $url)
{
//$isData = false;
$basedir = $data = '';
$needTempFile = true;
$attachmentData = ['name' => '', 'type' => '', 'file' => '', 'tmp_name' => ''];
try
{
// do not change urls for absolute images (thanks to corvuscorax)
if (!str_starts_with($url, 'data:'))
{
$attachmentData['name'] = basename($url); // need to resolve all sort of url
if (($directory = dirname($url)) == '.') $directory = '';
$ext = pathinfo($attachmentData['name'], PATHINFO_EXTENSION);
$attachmentData['type'] = MimeMagic::ext2mime($ext);
if ( strlen($directory) > 1 && !str_ends_with($directory, '/')) { $directory .= '/'; }
..
...
....
// processURL2InlineImages function
if ( $myUrl[0]!='/' && strlen($basedir) > 1 && !str_ends_with($basedir, '/')) { $basedir .= '/'; }
if ($needTempFile && empty($attachment) && !str_starts_with($myUrl, "http"))
{
try {
$data = file_get_contents($basedir.urldecode($myUrl));
}
catch (\Throwable $e) {
_egw_log_exception($e);
}
}
}
if (str_starts_with($url, 'data:'))PoC
- Log in as any authenticated EGroupware user with mail access and open the mail compose window.
- Switch to HTML body mode and insert: ``.
- The server executes file_get_contents('file:///etc/passwd'), writes the content to a temp file, and attaches it as an inline MIME part.
Impact
An authenticated attacker can read arbitrary files accessible by the web server process, including /etc/passwd, application configuration files containing database credentials, private TLS keys, and environment files.
Remediation
Enforce a strict URI scheme allowlist before calling file_get_contents(). Replace the check !str_starts_with($myUrl, 'http') with if (!preg_match('#^https?://#i', $myUrl)) { continue; } to reject file://, ftp://, php://, data://, and any other non-HTTP scheme.
Credited to smitocaru.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Composer (PHP) vulnerabilities
All Composer (PHP) entriesCVE-2026-63672
EGroupware: User-Controlled Identity Provider Selection in SAML Authentication
medium6.1Nov 17, 2026CVE-2026-27823
EGroupware has a Remote Code Execution Vulnerability
critical9.3Jul 7, 2026CVE-2026-40187
EGroupware has Authenticated RCE via Malicious eTemplate Upload
high8.6Jul 7, 2026CVE-2026-22243
EGroupware has SQL Injection in Nextmatch Filter Processing
high8.7Jan 28, 2026CVE-2024-40614
EGroupware mishandles an ORDER BY clause
high6.5Jul 7, 2024
