EGroupware Vulnerable to Local File Inclusion via file:// URI in Mail Compose
위협 신호 · CVSS · EPSS · KEV
이론적 심각도 점수
예측 데이터 없음
실측 악용 기록 없음
계획된 패치 주기 내 조치(60일 이내)
CVSS 벡터 · 메트릭
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N상세 설명
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
1// api/src/Mail.php 2foreach($images[2] as $i => $url) 3 { 4 //$isData = false; 5 $basedir = $data = ''; 6 $needTempFile = true; 7 $attachmentData = ['name' => '', 'type' => '', 'file' => '', 'tmp_name' => '']; 8 try 9 {10 // do not change urls for absolute images (thanks to corvuscorax)11 if (!str_starts_with($url, 'data:'))12 {13 $attachmentData['name'] = basename($url); // need to resolve all sort of url14 if (($directory = dirname($url)) == '.') $directory = '';15 $ext = pathinfo($attachmentData['name'], PATHINFO_EXTENSION);16 $attachmentData['type'] = MimeMagic::ext2mime($ext);17 if ( strlen($directory) > 1 && !str_ends_with($directory, '/')) { $directory .= '/'; }18..19...20....21// processURL2InlineImages function22if ( $myUrl[0]!='/' && strlen($basedir) > 1 && !str_ends_with($basedir, '/')) { $basedir .= '/'; }23 if ($needTempFile && empty($attachment) && !str_starts_with($myUrl, "http"))24 {25 try {26 $data = file_get_contents($basedir.urldecode($myUrl));27 }28 catch (\Throwable $e) {29 _egw_log_exception($e);30 }31 }32 }33 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:
<img src="file:///etc/passwd">. - 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.
AI 심층 분석
공격 시나리오 · 재현 가능한 PoC 페이로드 · 즉시 적용 가능한 차단 패치를 한 번에 받아 보세요. 보안 운영팀이 그대로 점검·티켓팅에 쓸 수 있는 형태로 정리해 드립니다.