Categories
CVE-2026-40187

OS Command Injection in egroupware/egroupware (CVE-2026-40187)

Summary

OS command injection in egroupware/egroupware (CVE-2026-40187). Risk of unauthorized operations or information disclosure. Exploitable via chgrp. Mitigation: upgrade to 23.1.20260601 or later.

Original description

The description as published by the source.

Summary

An authenticated administrator can achieve OS-level Remote Code Execution (RCE) by uploading a malicious eTemplate XML file (.xet) to the VFS /etemplates mount.

The Widget::expand_name() method passes template widget attribute values directly into a PHP eval() call with only double-quote escaping applied - backtick characters are not escaped.

In PHP, backticks inside a double-quoted eval() string execute shell commands. This allows an admin-level user to escalate from web
application access to arbitrary OS command execution on the server.


Details

The vulnerability is located in api/src/Etemplate/Widget.php, Widget::expand_name(): (lines 703–728)

The method is designed to expand PHP variables (e.g., $row, $col,$cont[id]) in widget attribute values for auto-repeat grids. The eval() is triggered whenever $name contains a $ character (line 706). The only sanitization applied before the eval is:

str_replace('"', '\\"', $name)

This escapes double quotes only. Backtick characters are not escaped. In PHP, backticks inside a double-quoted string in eval() are treated as shell execution operators — equivalent to shell_exec(). A widget id of $row\id`` produces:

eval('$name = "$row`id`";');  // executes shell command: id

expand_name() is called from:

  • form_name()
  • expand_widget()
  • set_attrs()
  • `Template::run…

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-40187 has been found in egroupware/egroupware.
Attackers can target a specific entry point like chgrp over the network to misuse the product.
Risk of unauthorized operations or information disclosure.
What to do: upgrade egroupware/egroupware to 23.1.20260601 or later.
If unsure, ask your IT team or search "egroupware/egroupware CVE-2026-40187" on the vendor's site.

CVE-2026-40187 (egroupware/egroupware) — CWE-78
Attack surface: chgrp / Admins / chmod / php.ini
Patched: 23.1.20260601 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

OS command injection (CWE-78) exists in egroupware/egroupware. Attackers reach the vulnerable code path via chgrp.

📍 Affected scope

Check the vendor advisory for the affected versions of egroupware/egroupware. Attack surface: chgrp / Admins / chmod / php.ini.

🔥 Severity

Severity: ?. Risk of unauthorized operations or information disclosure.

🔧 How to fix

Update to 23.1.20260601.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'egroupware/egroupware' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'egroupware/egroupware' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で egroupware/egroupware を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade egroupware/egroupware to 23.1.20260601

    ステージング環境で 23.1.20260601 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

composer egroupware/egroupware
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"23.1.20260601"}]}]
Packagist egroupware/egroupware
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"23.1.20260601"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details