Categories
CVE-2026-27602

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 via mv using full_address
  • modoboa/amavis/lib.py:202 — sa-learn using domain.name
  • modoboa/admin/models/mailbox.py:150 — doveadm user using full_address
  • modoboa/maillog/graphics.py:105–107 — rrdtool using domain.name
  • modoboa/webmail/models.py:54–57 — doveadm move/delete using account.email

PoC

  1. Deploy modoboa <= 2.7.0
  2. Log in as a Reseller or SuperAdmin
  3. Create a new domain named $(id>/tmp/proof).example.com with DKIM enabled
  4. 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.

❓ What is the problem

OS command injection (CWE-78) exists in modoboa. Attackers reach the vulnerable code path via full_address.

📍 Affected scope

Check the vendor advisory for the affected versions of modoboa. Attack surface: full_address / domain.name / rrdtool / account.email.

🔥 Severity

Severity: ?. Successful exploitation can lead to full system takeover.

🔧 How to fix

Update to 2.7.1.

🛡️ 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 '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

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

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

  2. 2
    Apply patch patch
    Upgrade modoboa to 2.7.1

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

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

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

Affected packages

PyPI modoboa
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.7.1"}]}]

References

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