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) groups=0(root)
Confirmed on commit b521bcb4f (latest main at time of discovery).
Impact
An 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.
Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.
CVE-2026-27602 has a CVSS score of 7.2 (High). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.7.1); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-27602? CVE-2026-27602 is a high-severity OS command injection vulnerability in modoboa (pip), affecting versions <= 2.7.0. It is fixed in 2.7.1. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
- How severe is CVE-2026-27602? CVE-2026-27602 has a CVSS score of 7.2 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of modoboa are affected by CVE-2026-27602? modoboa (pip) versions <= 2.7.0 is affected.
- Is there a fix for CVE-2026-27602? Yes. CVE-2026-27602 is fixed in 2.7.1. Upgrade to this version or later.
- Is CVE-2026-27602 exploitable, and should I be worried? Whether CVE-2026-27602 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-27602 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-27602? Upgrade
modoboato 2.7.1 or later.