---
id: "CVE-2026-45016"
page: "https://infrastack.ai/live/CVE-2026-45016"
kind: "vulnerability"
aliases: ["CVE-2026-45016", "GHSA-c8m7-r2jv-rw63"]
title: "EGroupware Vulnerable to Local File Inclusion via file:// URI in Mail Compose"
severity: "medium"
cvss: 6.5
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "EGroupware", "fixed": [], "affected": "", "ecosystem": "vendor"}, {"name": "egroupware/egroupware", "fixed": ["26.5.20260507"], "affected": ">= 26.0.20251208, < 26.5.20260507", "ecosystem": "composer"}, {"name": "egroupware/egroupware", "fixed": ["23.1.20260601"], "affected": "< 23.1.20260601", "ecosystem": "composer"}]
ecosystems: ["composer", "vendor"]
tags: ["cwe-73", "egroupware", "mail", "package", "php", "self-hosted"]
not_affected_if: ["auth-required", "no-mail-access"]
published_at: "2026-07-07T13:02:43+00:00"
first_seen_at: "2026-11-16T20:38:45+00:00"
updated_at: "2026-11-16T20:41:30+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-45016", "first_seen_at": "2026-11-16T20:38:45+00:00"}, {"source": "ghsa", "url": "https://github.com/advisories/GHSA-c8m7-r2jv-rw63", "first_seen_at": "2026-11-16T20:40:28+00:00"}]
exploit_sources: []
---

# EGroupware Vulnerable to Local File Inclusion via file:// URI in Mail Compose

Link for people: https://infrastack.ai/live/CVE-2026-45016 (this .md is for agents)

EGroupware's mail compose feature processes image URLs in HTML email bodies without restricting URI schemes, so a file:// URL makes the server read a local file. The file contents are then attached to outgoing email, which lets a logged-in user read files the web server process can access, including configuration with database credentials.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- vendor:EGroupware affected range not listed fixed no fixed version listed
- composer:egroupware/egroupware affected >= 26.0.20251208, < 26.5.20260507 fixed 26.5.20260507
- composer:egroupware/egroupware affected < 23.1.20260601 fixed 23.1.20260601

## How to check

- Find the EGroupware version with `grep -i version` on the installed `api/src` or the Composer lock file, then compare against the fixed versions below.
- Check `api/src/Mail.php` for the check `!str_starts_with($myUrl, 'http')` in the inline image handling (`processURL2InlineImages`).
- Note that the flaw needs an authenticated user with mail access; review who holds mail access.

## Fix

- `egroupware/egroupware` 26.x: move to `26.5.20260507`
- `egroupware/egroupware` 23.1.x: move to `23.1.20260601`

## Timeline

- 2026-11-16T20:38:45+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-45016
- 2026-11-16T20:40:28+00:00 ghsa https://github.com/advisories/GHSA-c8m7-r2jv-rw63

## Documents

- [advisory] Vendor advisory: github.com https://github.com/EGroupware/egroupware/security/advisories/GHSA-c8m7-r2jv-rw63
- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/EGroupware/egroupware/security-advisories/GHSA-c8m7-r2jv-rw63
- [fix] Patch: github.com https://github.com/EGroupware/egroupware/commit/38a0277fc1a4b55125a4e133fc9579efb462a573
- [fix] Patch: github.com https://github.com/EGroupware/egroupware/commit/7ae1cdff681f8b39fe274f65d9259cb5c83ada56
- [fix] Release notes: github.com https://github.com/EGroupware/egroupware/releases/tag/23.1.20260601
- [fix] Release notes: github.com https://github.com/EGroupware/egroupware/releases/tag/26.5.20260507

## From the sources

### 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**


```php
// 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
1. Log in as any authenticated EGroupware user with mail access and open the mail compose window.
2. Switch to HTML body mode and insert: `<img src="file:///etc/passwd">`. 
3. 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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
