CVE-2026-27602: Modoboa Modoboa Has OS Command Injection Vulnerability

HIGH
Advisory Identifier: GHSA-wwv8-cqpr-vx3m
CVSS 7.2
CWE-78
Published
Advisory Summary

CVE-2026-27602 is a HIGH (CVSS 7.2) modoboa has os command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Modoboa libraries in the PyPI ecosystem. The issue involves modoboa has os command injection. Remediation is available by upgrading affected packages to version 2.7.1.

CVE-2026-27602 at a Glance

CVE Identifier CVE-2026-27602
GHSA Identifier GHSA-wwv8-cqpr-vx3m
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Modoboa
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-27602

To remediate this vulnerability, upgrade all affected Modoboa dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

modoboa fixed: 2.7.1
pip install modoboa>=2.7.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show modoboa

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-27602, inspect your installed packages using pip:

pip show modoboa

Analyze the terminal output to locate any version of Modoboa in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.7.1), your application is affected.

Note: The pip show modoboa command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Modoboa, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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`: ```python 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: ```python 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) 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.

CVE-2026-27602 Affected Modoboa Versions

1 component(s)
Fixed Versions:
2.7.1
Product / Package Ecosystem Affected Versions Fixed Version
modoboa
PyPI
< 2.7.1
2.7.1

References

Frequently Asked Questions

What is CVE-2026-27602?
CVE-2026-27602 is a security vulnerability in Modoboa involving Modoboa has OS Command Injection under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Modoboa versions are affected?
Affected versions include releases prior to 2.7.1 across affected packages: modoboa.
What version fixes CVE-2026-27602?
Upgrading to 2.7.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is modoboa affected?
Yes, modoboa is affected in releases prior to 2.7.1. Upgrade your dependency to 2.7.1 or later.
What is the CVSS score of CVE-2026-27602?
CVE-2026-27602 has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-27602?
CVE-2026-27602 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2026-27602?
Run the dependency tree command: 'pip show modoboa'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wwv8-cqpr-vx3m",
  "modified" : "2026-03-27T22:08:53Z",
  "published" : "2026-03-25T17:03:37Z",
  "aliases" : [ "CVE-2026-27602" ],
  "summary" : "Modoboa has OS Command Injection",
  "details" : "### 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "modoboa"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.7.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.7.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/modoboa/modoboa/security/advisories/GHSA-wwv8-cqpr-vx3m"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-27602"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modoboa/modoboa/commit/27a7aa133d3608fe8c25ae39125d1012c333cbfa"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/modoboa/modoboa"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modoboa/modoboa/releases/tag/2.7.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-03-25T17:03:37Z",
    "nvd_published_at" : "2026-03-25T19:16:48Z"
  }
}