{"id":"CVE-2026-45016","kind":"vulnerability","aliases":["CVE-2026-45016","GHSA-c8m7-r2jv-rw63"],"related":[],"title":"EGroupware Vulnerable to Local File Inclusion via file:// URI in Mail Compose","description":"### 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.","summary":"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.","severity":"medium","cvss":6.5,"epss":null,"exploited":false,"exploited_at":null,"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"],"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.\n- Check `api/src/Mail.php` for the check `!str_starts_with($myUrl, 'http')` in the inline image handling (`processURL2InlineImages`).\n- 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`\n- `egroupware/egroupware` 23.1.x: move to `23.1.20260601`","status":"open","published_at":"2026-07-07T13:02:43+00:00","first_seen_at":"2026-11-16T20:38:45+00:00","triaged_at":"2026-11-16T20:41:30+00:00","updated_at":"2026-11-16T20:41:30+00:00","category":"package","confidence":0.85,"triage":{"at":"2026-11-16T20:41:30Z","model":"claude-haiku-5-5","output":{"fix":"- `egroupware/egroupware` 26.x: move to `26.5.20260507`\n- `egroupware/egroupware` 23.1.x: move to `23.1.20260601`","reach":"internet","title":"EGroupware: mail compose reads server files via file:// image URLs","impact":"high","summary":"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.","audience":"businesses","category":"package","nicknames":[],"who_cares":["egroupware","php","self-hosted","mail"],"confidence":0.85,"fix_status":"available","needs_auth":"yes","worst_case":"Authenticated users read server files, including secrets and TLS keys.","analyst_note":"","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.\n- Check `api/src/Mail.php` for the check `!str_starts_with($myUrl, 'http')` in the inline image handling (`processURL2InlineImages`).\n- Note that the flaw needs an authenticated user with mail access; review who holds mail access.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["auth-required","no-mail-access"],"who_is_affected":"EGroupware installations that let users compose HTML mail with the mail app enabled are exposed; the flawed code runs when an image URL is embedded in an outgoing message. Any authenticated user with mail access can trigger it, so the attack needs an account. Instances on the fixed versions or without mail access can skip it.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"no","severity_if_unknown":"unknown"},"cost_usd":0.000901,"input_tokens":5720,"output_tokens":659,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-2026':13A,21A '-45016':14A,22A '-73':27B '/etc/passwd':148C,301C,332C '0':230C '1':220C,233C,269C '2':157C,286C '3':294C 'absolut':179C 'access':84B,279C,325C 'allowlist':351C 'api/src/mail.php':154C 'applic':333C 'arbitrari':129C,323C 'attach':66B,141C,242C,310C 'attachmentdata':167C,190C,208C,212C 'attack':320C 'authent':274C,319C 'basedir':124C,163C,232C,237C,238C 'basedir.urldecode':253C 'basenam':192C 'bodi':46B,101C,290C 'c8m7':17A 'call':353C 'catch':255C 'caus':120C 'chang':176C 'check':109C,359C 'compos':11A,38B,284C 'configur':86B,334C 'contain':336C 'content':63B,123C,252C,300C,304C,356C 'continu':372C 'corvuscorax':183C 'credenti':89B,338C 'cve':12A,20A 'cwe':26B 'data':164C,189C,249C,267C 'databas':88B,337C 'directori':202C,205C,219C,224C,225C 'dirnam':203C 'e':257C,261C 'egroupwar':1A,28B,35B,275C 'egroupware':23A 'egroupware/egroupware':24A,25A 'egw':258C 'email':45B,69B,100C,144C 'emb':136C 'embed':96C 'empti':241C 'end':222C,235C 'enforc':346C 'environ':343C 'evalu':115C 'except':260C 'execut':297C 'ext':206C,216C 'ext2mime':215C 'extens':211C 'fals':150C,151C,162C 'featur':39B 'file':5A,60B,62B,78B,121C,130C,170C,250C,298C,308C,324C,335C,344C,354C 'filesystem':134C 'foreach':155C 'function':92C,227C 'get':122C,251C,299C,355C 'ghsa':16A 'ghsa-c8m7-r2jv-rw63':15A 'host':34B 'html':44B,99C,289C 'http':114C,149C,247C,364C,380C 'https':369C 'imag':41B,94C,156C,180C 'impact':317C 'includ':85B,331C 'inclus':6A 'inlin':139C,314C 'insert':293C 'isdata':161C 'key':341C 'let':71B 'local':4A,59B 'log':74B,259C,270C 'logged-in':73B 'mail':10A,29B,37B,278C,283C 'make':54B 'match':368C 'mime':140C,315C 'mimemag':214C 'mode':291C 'myurl':113C,126C,229C,246C,254C,363C,371C 'name':168C,172C,191C,209C 'need':194C 'needtempfil':165C,240C 'non':379C 'non-http':378C 'open':281C 'outgo':68B,143C 'packag':30B 'part':316C 'pathinfo':207C,210C 'php':31B,153C 'poc':268C 'preg':367C 'privat':339C 'process':40B,82B,93C,330C 'processurl2inlineimages':226C 'r2jv':18A 'read':57B,77B,128C,322C 'reject':374C 'remedi':345C 'replac':357C 'resolv':196C 'restrict':48B,105C 'rw63':19A 'scheme':50B,107C,350C,381C 'self':33B 'self-host':32B 'server':56B,81B,133C,296C,329C 'sort':198C 'start':111C,146C,186C,244C,264C,361C 'str':110C,145C,185C,221C,234C,243C,263C,360C 'strict':348C 'strlen':218C,231C 'summari':90C 'switch':287C 'temp':307C 'thank':181C 'throwabl':256C 'tls':340C 'tmp':171C 'tri':173C,248C 'true':117C,152C,166C 'type':169C,213C 'uri':8A,49B,106C,119C,349C 'url':42B,53B,95C,160C,177C,188C,193C,200C,204C,266C 'urldecod':125C 'user':76B,276C 'valid':103C 'via':7A 'vulner':2A 'web':80B,328C 'window':285C 'without':47B,102C 'write':302C","nicknames":[],"mitigations":[],"who_affected":"EGroupware installations that let users compose HTML mail with the mail app enabled are exposed; the flawed code runs when an image URL is embedded in an outgoing message. Any authenticated user with mail access can trigger it, so the attack needs an account. Instances on the fixed versions or without mail access can skip it.","tier":"C","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"businesses","plain_action":null,"pkeys":["egroupware","egroupwareegroupware"],"ptokens":["egroupware"],"labels":["composer","cwe73","egroupware","mail","medium","package","php","selfhosted","vendor"],"campaign_type":null,"search_a":"'-2026':13A,21A '-45016':14A,22A 'c8m7':17A 'compos':11A 'cve':12A,20A 'egroupwar':1A 'egroupware':23A 'egroupware/egroupware':24A,25A 'file':5A 'ghsa':16A 'ghsa-c8m7-r2jv-rw63':15A 'inclus':6A 'local':4A 'mail':10A 'r2jv':18A 'rw63':19A 'uri':8A 'via':7A 'vulner':2A","search_b":"'-73':27B 'access':84B 'attach':66B 'bodi':46B 'compos':38B 'configur':86B 'content':63B 'credenti':89B 'cwe':26B 'databas':88B 'egroupwar':28B,35B 'email':45B,69B 'featur':39B 'file':60B,62B,78B 'host':34B 'html':44B 'imag':41B 'includ':85B 'let':71B 'local':59B 'log':74B 'logged-in':73B 'mail':29B,37B 'make':54B 'outgo':68B 'packag':30B 'php':31B 'process':40B,82B 'read':57B,77B 'restrict':48B 'scheme':50B 'self':33B 'self-host':32B 'server':56B,81B 'uri':49B 'url':42B,53B 'user':76B 'web':80B 'without':47B","search_c":"'/etc/passwd':148C,301C,332C '0':230C '1':220C,233C,269C '2':157C,286C '3':294C 'absolut':179C 'access':279C,325C 'allowlist':351C 'api/src/mail.php':154C 'applic':333C 'arbitrari':129C,323C 'attach':141C,242C,310C 'attachmentdata':167C,190C,208C,212C 'attack':320C 'authent':274C,319C 'basedir':124C,163C,232C,237C,238C 'basedir.urldecode':253C 'basenam':192C 'bodi':101C,290C 'call':353C 'catch':255C 'caus':120C 'chang':176C 'check':109C,359C 'compos':284C 'configur':334C 'contain':336C 'content':123C,252C,300C,304C,356C 'continu':372C 'corvuscorax':183C 'credenti':338C 'data':164C,189C,249C,267C 'databas':337C 'directori':202C,205C,219C,224C,225C 'dirnam':203C 'e':257C,261C 'egroupwar':275C 'egw':258C 'email':100C,144C 'emb':136C 'embed':96C 'empti':241C 'end':222C,235C 'enforc':346C 'environ':343C 'evalu':115C 'except':260C 'execut':297C 'ext':206C,216C 'ext2mime':215C 'extens':211C 'fals':150C,151C,162C 'file':121C,130C,170C,250C,298C,308C,324C,335C,344C,354C 'filesystem':134C 'foreach':155C 'function':92C,227C 'get':122C,251C,299C,355C 'html':99C,289C 'http':114C,149C,247C,364C,380C 'https':369C 'imag':94C,156C,180C 'impact':317C 'includ':331C 'inlin':139C,314C 'insert':293C 'isdata':161C 'key':341C 'log':259C,270C 'mail':278C,283C 'match':368C 'mime':140C,315C 'mimemag':214C 'mode':291C 'myurl':113C,126C,229C,246C,254C,363C,371C 'name':168C,172C,191C,209C 'need':194C 'needtempfil':165C,240C 'non':379C 'non-http':378C 'open':281C 'outgo':143C 'part':316C 'pathinfo':207C,210C 'php':153C 'poc':268C 'preg':367C 'privat':339C 'process':93C,330C 'processurl2inlineimages':226C 'read':128C,322C 'reject':374C 'remedi':345C 'replac':357C 'resolv':196C 'restrict':105C 'scheme':107C,350C,381C 'server':133C,296C,329C 'sort':198C 'start':111C,146C,186C,244C,264C,361C 'str':110C,145C,185C,221C,234C,243C,263C,360C 'strict':348C 'strlen':218C,231C 'summari':90C 'switch':287C 'temp':307C 'thank':181C 'throwabl':256C 'tls':340C 'tmp':171C 'tri':173C,248C 'true':117C,152C,166C 'type':169C,213C 'uri':106C,119C,349C 'url':95C,160C,177C,188C,193C,200C,204C,266C 'urldecod':125C 'user':276C 'valid':103C 'web':328C 'window':285C 'without':102C 'write':302C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-07-06T05:49:00+00:00","kev":null,"cvss_vector":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-45016","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45016","severity":null,"published_at":"2026-11-16T20:19:04+00:00","modified_at":"2026-11-16T20:19:04+00:00","first_seen_at":"2026-11-16T20:38:45+00:00","fetched_at":"2026-11-16T20:38:45+00:00","note":null},{"source":"ghsa","external_id":"GHSA-c8m7-r2jv-rw63","url":"https://github.com/advisories/GHSA-c8m7-r2jv-rw63","severity":"medium","published_at":"2026-07-07T13:02:43+00:00","modified_at":"2026-07-07T13:02:48+00:00","first_seen_at":"2026-11-16T20:40:28+00:00","fetched_at":"2026-11-16T20:40:28+00:00","note":null}],"documents":[{"id":172279,"url":"https://github.com/EGroupware/egroupware/commit/38a0277fc1a4b55125a4e133fc9579efb462a573","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":172280,"url":"https://github.com/EGroupware/egroupware/commit/7ae1cdff681f8b39fe274f65d9259cb5c83ada56","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":172281,"url":"https://github.com/EGroupware/egroupware/releases/tag/23.1.20260601","title":"Release notes: github.com","kind":"release","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release notes: github.com"},{"id":172282,"url":"https://github.com/EGroupware/egroupware/releases/tag/26.5.20260507","title":"Release notes: github.com","kind":"release","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release notes: github.com"},{"id":172283,"url":"https://github.com/EGroupware/egroupware/security/advisories/GHSA-c8m7-r2jv-rw63","title":"Vendor advisory: github.com","kind":"vendor","source":"nvd","publisher":"vendor","text":null,"published_at":"2026-07-06T05:49:00+00:00","relation":"advisory","confidence":null,"note":"Vendor advisory: github.com"},{"id":172335,"url":"https://api.github.com/repos/EGroupware/egroupware/security-advisories/GHSA-c8m7-r2jv-rw63","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}