GHSA-C8M7-R2JV-RW63

Vulnerability from github – Published: 2026-07-07 13:02 – Updated: 2026-07-07 13:02
VLAI
Summary
EGroupware Vulnerable to Local File Inclusion via file:// URI in Mail Compose
Details

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

  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.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "egroupware/egroupware"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "26.0.20251208"
            },
            {
              "fixed": "26.5.20260507"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "egroupware/egroupware"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "23.1.20260601"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-45016"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-73"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-07T13:02:43Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "### Summary\nThe function processes image URLs embedded in an HTML email body without validating or restricting URI schemes. The check `!str_starts_with($myUrl, \u0027http\u0027)` 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(\u0027file:///etc/passwd\u0027, \u0027http\u0027) \u2192 **false**\n!false \u2192 **true**\n\n\n```php\n// api/src/Mail.php  \nforeach($images[2] as $i =\u003e $url)\n\t\t\t{\n\t\t\t\t//$isData = false;\n\t\t\t\t$basedir = $data = \u0027\u0027;\n\t\t\t\t$needTempFile = true;\n\t\t\t\t$attachmentData = [\u0027name\u0027 =\u003e \u0027\u0027, \u0027type\u0027 =\u003e \u0027\u0027, \u0027file\u0027 =\u003e \u0027\u0027, \u0027tmp_name\u0027 =\u003e \u0027\u0027];\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, \u0027data:\u0027))\n\t\t\t\t\t{\n\t\t\t\t\t\t$attachmentData[\u0027name\u0027] = basename($url); // need to resolve all sort of url\n\t\t\t\t\t\tif (($directory = dirname($url)) == \u0027.\u0027) $directory = \u0027\u0027;\n\t\t\t\t\t\t$ext = pathinfo($attachmentData[\u0027name\u0027], PATHINFO_EXTENSION);\n\t\t\t\t\t\t$attachmentData[\u0027type\u0027] = MimeMagic::ext2mime($ext);\n\t\t\t\t\t\tif ( strlen($directory) \u003e 1 \u0026\u0026 !str_ends_with($directory, \u0027/\u0027)) { $directory .= \u0027/\u0027; }\n..\n...\n....\n// processURL2InlineImages function\nif ( $myUrl[0]!=\u0027/\u0027 \u0026\u0026 strlen($basedir) \u003e 1 \u0026\u0026 !str_ends_with($basedir, \u0027/\u0027)) { $basedir .= \u0027/\u0027; }\n\t\t\t\t\t\tif ($needTempFile \u0026\u0026 empty($attachment) \u0026\u0026 !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, \u0027data:\u0027))\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: `\u003cimg src=\"file:///etc/passwd\"\u003e`. \n3. The server executes file_get_contents(\u0027file:///etc/passwd\u0027), 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, \u0027http\u0027)` with `if (!preg_match(\u0027#^https?://#i\u0027, $myUrl)) { continue; }` to reject `file://`, `ftp://`, `php://`, `data://`, and any other non-HTTP scheme.",
  "id": "GHSA-c8m7-r2jv-rw63",
  "modified": "2026-07-07T13:02:43Z",
  "published": "2026-07-07T13:02:43Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/EGroupware/egroupware/security/advisories/GHSA-c8m7-r2jv-rw63"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/EGroupware/egroupware"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "EGroupware Vulnerable to Local File Inclusion via file:// URI in Mail Compose"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.