{"id":"CVE-2026-45016","aliases":["CVE-2026-45016","GHSA-c8m7-r2jv-rw63"],"related":[],"kind":"vulnerability","state":"published","title":"EGroupware: Local File Inclusion via file:// URI in Mail Compose","summary":"EGroupware is a web-based groupware server written in PHP. Prior to 23.1.20260601 and 26.5.20260507, the processURL2InlineImages logic in api/src/Mail.php treats non-HTTP image sources in an HTML mail body as local paths and passes a decoded attacker-controlled file:// URI to file_get_contents. Any authenticated user with mail access can cause files readable by the web server process to be embedded as inline MIME attachments in outgoing email, exposing local configuration, credentials, private keys, or other server files. This issue is fixed in versions 23.1.20260601 and 26.5.20260507.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"EGroupware is a web-based groupware server written in PHP. Prior to 23.1.20260601 and 26.5.20260507, the processURL2InlineImages logic in api/src/Mail.php treats non-HTTP image sources in an HTML mail body as local paths and passes a decoded attacker-controlled file:// URI to file_get_contents. Any authenticated user with mail access can cause files readable by the web server process to be embedded as inline MIME attachments in outgoing email, exposing local configuration, credentials, private keys, or other server files. This issue is fixed in versions 23.1.20260601 and 26.5.20260507.","source":"cvelist"},{"lang":"en","text":"### Summary\nThe 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.\n\nstr_starts_with('file:///etc/passwd', 'http') → **false**\n!false → **true**\n\n\n```php\n// api/src/Mail.php  \nforeach($images[2] as $i => $url)\n\t\t\t{\n\t\t\t\t//$isData = false;\n\t\t\t\t$basedir = $data = '';\n\t\t\t\t$needTempFile = true;\n\t\t\t\t$attachmentData = ['name' => '', 'type' => '', 'file' => '', 'tmp_name' => ''];\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// do not change urls for absolute images (thanks to corvuscorax)\n\t\t\t\t\tif (!str_starts_with($url, 'data:'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$attachmentData['name'] = basename($url); // need to resolve all sort of url\n\t\t\t\t\t\tif (($directory = dirname($url)) == '.') $directory = '';\n\t\t\t\t\t\t$ext = pathinfo($attachmentData['name'], PATHINFO_EXTENSION);\n\t\t\t\t\t\t$attachmentData['type'] = MimeMagic::ext2mime($ext);\n\t\t\t\t\t\tif ( strlen($directory) > 1 && !str_ends_with($directory, '/')) { $directory .= '/'; }\n..\n...\n....\n// processURL2InlineImages function\nif ( $myUrl[0]!='/' && strlen($basedir) > 1 && !str_ends_with($basedir, '/')) { $basedir .= '/'; }\n\t\t\t\t\t\tif ($needTempFile && empty($attachment) && !str_starts_with($myUrl, \"http\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t$data = file_get_contents($basedir.urldecode($myUrl));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (\\Throwable $e) {\n\t\t\t\t\t\t\t\t_egw_log_exception($e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (str_starts_with($url, 'data:'))\n```\n\n### PoC\n1. Log in as any authenticated EGroupware user with mail access and open the mail compose window.\n2. Switch to HTML body mode and insert: `<img src=\"file:///etc/passwd\">`. \n3. The server executes file_get_contents('file:///etc/passwd'), writes the content to a temp file, and attaches it as an inline MIME part. \n\n\n### Impact\nAn 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.\n\n\n### Remediation\nEnforce 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.","format":"markdown","source":"ghsa"}],"published":"2026-07-07T13:02:43.000Z","modified":"2026-11-18T18:19:17.883Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.0","vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-73"],"affected":[{"ranges":[{"version":"< 23.1.20260601","status":"affected"},{"version":">= 26.0.20251208, < 26.5.20260507","status":"affected"}],"vendor":"EGroupware","product":"egroupware","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"26.0.20251208","status":"affected","fixed":"26.5.20260507"}],"ecosystem":"Packagist","package":"egroupware/egroupware","purl":"pkg:composer/egroupware/egroupware","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"23.1.20260601"}],"ecosystem":"Packagist","package":"egroupware/egroupware","purl":"pkg:composer/egroupware/egroupware","source":"ghsa"}],"references":[{"url":"https://github.com/EGroupware/egroupware/security/advisories/GHSA-c8m7-r2jv-rw63","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/EGroupware/egroupware/commit/38a0277fc1a4b55125a4e133fc9579efb462a573","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/EGroupware/egroupware/commit/7ae1cdff681f8b39fe274f65d9259cb5c83ada56","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/EGroupware/egroupware/releases/tag/23.1.20260601","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/EGroupware/egroupware/releases/tag/26.5.20260507","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/EGroupware/egroupware","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-11-18T17:49:03.690Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45016","url":"https://www.cve.org/CVERecord?id=CVE-2026-45016","licence":"CVE Terms of Use","modified":"2026-11-18T17:49:36.405Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c8m7-r2jv-rw63","url":"https://github.com/advisories/GHSA-c8m7-r2jv-rw63","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:11.481Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45016","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45016","licence":"Public domain","modified":"2026-11-18T18:19:17.883Z"}],"updatedAt":"2026-11-25T22:59:50.923Z","epss":{"score":0.00422,"percentile":0.38456,"date":"2026-12-01T12:00:22.000Z"}}