← Back to CVE Explorer

CVE-2026-40871

Full vulnerability record from the local CVENow database.

Description

mailcow: dockerized is an open source groupware/email suite based on docker. Versions prior to 2026-03b have a second-order SQL injection vulnerability in the quarantine_category field via the Mailcow API. The /api/v1/add/mailbox endpoint stores quarantine_category without validation or sanitization. This value is later used by quarantine_notify.py, which constructs SQL queries using unsafe % string formatting instead of parameterized queries. This results in a delayed (second-order) SQL injection when the quarantine notification job executes, allowing an attacker to inject arbitrary SQL. Using a UNION SELECT, sensitive data (e.g., admin credentials) can be exfiltrated and rendered inside quarantine notification emails. Version 2026-03b fixes the vulnerability.

Severity
HIGH
CVSS score
7.2 (v3.1)
Vulnerability status
Deferred
Source identifier
Published
2026-04-21 20:17:00.527000
Last modified
2026-10-26 22:10:00.163000
View original CVE JSON
{
  "id": "CVE-2026-40871",
  "sourceIdentifier": "[email protected]",
  "published": "2026-04-21T20:17:00.527",
  "lastModified": "2026-10-26T22:10:00.163",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "mailcow: dockerized is an open source groupware/email suite based on docker. Versions prior to 2026-03b have a second-order SQL injection vulnerability in the quarantine_category field via the Mailcow API. The /api/v1/add/mailbox endpoint stores quarantine_category without validation or sanitization. This value is later used by quarantine_notify.py, which constructs SQL queries using unsafe % string formatting instead of parameterized queries. This results in a delayed (second-order) SQL injection when the quarantine notification job executes, allowing an attacker to inject arbitrary SQL. Using a UNION SELECT, sensitive data (e.g., admin credentials) can be exfiltrated and rendered inside quarantine notification emails. Version 2026-03b fixes the vulnerability."
    },
    {
      "lang": "es",
      "value": "mailcow: dockerized es una suite de groupware/correo electrónico de código abierto basada en docker. Las versiones anteriores a 2026-03b tienen una vulnerabilidad de inyección SQL de segundo orden en el campo quarantine_category a través de la API de Mailcow. El endpoint /api/v1/add/mailbox almacena quarantine_category sin validación ni saneamiento. Este valor es utilizado posteriormente por quarantine_notify.py, que construye consultas SQL utilizando formato de cadena % inseguro en lugar de consultas parametrizadas. Esto resulta en una inyección SQL retrasada (de segundo orden) cuando se ejecuta el trabajo de notificación de cuarentena, permitiendo a un atacante inyectar SQL arbitrario. Usando un UNION SELECT, los datos sensibles (p. ej., credenciales de administrador) pueden ser exfiltrados y renderizados dentro de los correos electrónicos de notificación de cuarentena. La versión 2026-03b corrige la vulnerabilidad."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "mailcow",
          "product": "mailcow-dockerized",
          "versions": [
            {
              "version": "< 2026-03b",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
          "baseScore": 7.2,
          "baseSeverity": "HIGH",
          "attackVector": "NETWORK",
          "attackComplexity": "LOW",
          "privilegesRequired": "HIGH",
          "userInteraction": "NONE",
          "scope": "UNCHANGED",
          "confidentialityImpact": "HIGH",
          "integrityImpact": "HIGH",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 1.2,
        "impactScore": 5.9
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-04-21T19:53:34.653739Z",
          "id": "CVE-2026-40871",
          "options": [
            {
              "exploitation": "poc"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "total"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-20"
        },
        {
          "lang": "en",
          "value": "CWE-89"
        },
        {
          "lang": "en",
          "value": "CWE-116"
        },
        {
          "lang": "en",
          "value": "CWE-564"
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-r8fq-wrfm-cj2q",
      "source": "[email protected]"
    },
    {
      "url": "https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-r8fq-wrfm-cj2q",
      "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"
    }
  ]
}