CVE-2026-40871
JSON

7.2high

mailcow: dockerized vulnerable to Second Order SQL Injection in quarantine category via API

Severity
7.2high CVSS:3.1 by GitHub_M
Exploit likelihood
8.89% (higher than 95% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

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.

Affected

Product or packageVersionsReported by
mailcow mailcow-dockerized< 2026-03bCVE List

Classification

CWE-20CWE-89CWE-116CWE-564

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

What each source says

CVE List

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.

NVD (es)

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.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-40871 changed 2026-04-21CVE Terms of Use
NVDCVE-2026-40871 changed 2026-10-26Public domain