{"id":"CVE-2026-27602","aliases":["CVE-2026-27602","GHSA-wwv8-cqpr-vx3m","PYSEC-2026-2223"],"related":[],"kind":"vulnerability","state":"published","title":"Modoboa has an OS Command Injection","summary":"Modoboa is a mail hosting and management platform. Prior to version 2.7.1, `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. Version 2.7.1 patches the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Modoboa is a mail hosting and management platform. Prior to version 2.7.1, `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. Version 2.7.1 patches the issue.","source":"cvelist"},{"lang":"en","text":"### Summary\n\n`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.\n\n### Details\n\nThe root cause is in `modoboa/lib/sysutils.py:31`:\n\n```python\nkwargs[\"shell\"] = True\nprocess = subprocess.Popen(cmd, **kwargs)\n```\n\nWhen a create a domain is created with DKIM enabled, the domain name gets embedded into a shell command like this:\n\n```python\nexec_cmd(f\"openssl genrsa -out {dkim_storage_dir}/{domain.name}.pem {key_size}\")\n```\n\nIf the domain name contains something like `$(id>/tmp/proof).example.com`, the shell executes the injected command before running openssl.\n\nThe same pattern appears in several other places:\n\n- `modoboa/admin/jobs.py:38` — mailbox rename via `mv` using `full_address`\n- `modoboa/amavis/lib.py:202` — `sa-learn` using `domain.name`\n- `modoboa/admin/models/mailbox.py:150` — `doveadm user` using `full_address`\n- `modoboa/maillog/graphics.py:105–107` — `rrdtool` using `domain.name`\n- `modoboa/webmail/models.py:54–57` — `doveadm move/delete` using `account.email`\n\n### PoC\n\n1. Deploy modoboa <= 2.7.0\n2. Log in as a Reseller or SuperAdmin\n3. Create a new domain named `$(id>/tmp/proof).example.com` with DKIM enabled\n4. SSH into the server and read `/tmp/proof`\n\nSomething like this will be displayed:\n\n```\nuid=0(root) gid=0(root) groups=0(root)\n```\n\nConfirmed on commit b521bcb4f (latest main at time of discovery).\n\n### Impact\n\nAn attacker with Reseller-level access (or higher) can execute arbitrary OS commands on the mail server — in a typical Modoboa deployment this means running as root. All six identified sinks are reachable through normal application workflows.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Modoboa es una plataforma de alojamiento y gestión de correo. Antes de la versión 2.7.1, `exec_cmd()` en `modoboa/lib/sysutils.py` siempre ejecuta llamadas a subprocesos con `shell=True`. Dado que los nombres de dominio fluyen directamente a las cadenas de comandos de shell sin ninguna sanitización, un Revendedor o SuperAdministrador puede incluir metacaracteres de shell en un nombre de dominio para ejecutar comandos arbitrarios del sistema operativo en el servidor. La versión 2.7.1 corrige el problema.","source":"nvd"}],"published":"2026-03-25T17:03:37.000Z","modified":"2026-07-13T07:26:17.517Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","score":7.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","score":7.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","score":7.2,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H","score":7.2,"rating":"HIGH"}],"cwes":["CWE-78"],"affected":[{"ranges":[{"version":"< 2.7.1","status":"affected"}],"vendor":"modoboa","product":"modoboa","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.7.1"}],"ecosystem":"PyPI","package":"modoboa","purl":"pkg:pypi/modoboa","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.7.1"}],"vendor":"modoboa","product":"modoboa","cpe":"cpe:2.3:a:modoboa:modoboa:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.7.1"}],"ecosystem":"PyPI","package":"modoboa","purl":"pkg:pypi/modoboa","source":"pysec"}],"references":[{"url":"https://github.com/modoboa/modoboa/security/advisories/GHSA-wwv8-cqpr-vx3m","tags":["evidence","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/modoboa/modoboa/commit/27a7aa133d3608fe8c25ae39125d1012c333cbfa","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/modoboa/modoboa/releases/tag/2.7.1","tags":["advisory","product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27602","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/modoboa/modoboa","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-03-26T15:38:34.373Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-27602","url":"https://www.cve.org/CVERecord?id=CVE-2026-27602","licence":"CVE Terms of Use","modified":"2026-03-26T15:38:37.459Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wwv8-cqpr-vx3m","url":"https://github.com/advisories/GHSA-wwv8-cqpr-vx3m","licence":"CC-BY-4.0","modified":"2026-07-13T07:26:17.517Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-27602","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27602","licence":"Public domain","modified":"2026-06-17T10:27:22.557Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2223","url":"https://osv.dev/vulnerability/PYSEC-2026-2223","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:37.255Z"}],"updatedAt":"2026-11-25T22:59:16.880Z","epss":{"score":0.00804,"percentile":0.53583,"date":"2026-11-30T12:00:22.000Z"}}