OS Command Injection in modoboa (CVE-2026-27602)
Summary
OS command injection in modoboa (CVE-2026-27602). Successful exploitation can lead to full system takeover. Exploitable via full_address. Mitigation: upgrade to 2.7.1 or later.
Original description
The description as published by the source.
Summary
exec_cmd() in modoboa/lib/sysutils.py always runs subprocess calls with shell=True. Since domain names flow directly into shell command strings without any sanitization, a Reseller or SuperAdmin can include shell metacharacters in a domain name to run arbitrary OS commands on the server.
Details
The root cause is in modoboa/lib/sysutils.py:31:
kwargs["shell"] = True
process = subprocess.Popen(cmd, **kwargs)
When a create a domain is created with DKIM enabled, the domain name gets embedded into a shell command like this:
exec_cmd(f"openssl genrsa -out {dkim_storage_dir}/{domain.name}.pem {key_size}")
If the domain name contains something like $(id>/tmp/proof).example.com, the shell executes the injected command before running openssl.
The same pattern appears in several other places:
modoboa/admin/jobs.py:38— mailbox rename viamvusingfull_addressmodoboa/amavis/lib.py:202—sa-learnusingdomain.namemodoboa/admin/models/mailbox.py:150—doveadm userusingfull_addressmodoboa/maillog/graphics.py:105–107—rrdtoolusingdomain.namemodoboa/webmail/models.py:54–57—doveadm move/deleteusingaccount.email
PoC
- Deploy modoboa <= 2.7.0
- Log in as a Reseller or SuperAdmin
- Create a new domain named
$(id>/tmp/proof).example.comwith DKIM enabled - SSH into the server and read
/tmp/proof
Something like this will be displayed:
uid=0(root) gid=0(root) group…
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
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-27602 has been found in modoboa.
Attackers can target a specific entry point like full_address over the network to misuse the product.
Successful exploitation can lead to full system takeover.
What to do: upgrade modoboa to 2.7.1 or later.
If unsure, ask your IT team or search "modoboa CVE-2026-27602" on the vendor's site.
CVE-2026-27602 (modoboa) — CWE-78
Attack vector: remote (network-reachable) / no user interaction
Attack surface: full_address / domain.name / rrdtool / account.email
Patched: 2.7.1 — 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.
OS command injection (CWE-78) exists in modoboa. Attackers reach the vulnerable code path via full_address.
Check the vendor advisory for the affected versions of modoboa. Attack surface: full_address / domain.name / rrdtool / account.email.
Severity: ?. Successful exploitation can lead to full system takeover.
Update to 2.7.1.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'modoboa' . 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
-
1Identify exposure identify
grep -r 'modoboa' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
modoboaを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade modoboa to 2.7.1ステージング環境で 2.7.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web github.com