# CVE-2026-40871: mailcow: dockerized vulnerable to Second Order SQL Injection in quarantine category via API

- Severity: High 7.2 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 8.89%, higher than 95% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-04-21T19:12:52.781Z
- Modified: 2026-10-26T22:10:00.163Z
- Weaknesses: CWE-20, CWE-89, CWE-116, CWE-564
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- 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.

(As written by CVE List.)

## Affected

- mailcow mailcow-dockerized: < 2026-03b

## References

- <https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-r8fq-wrfm-cj2q> (exploit)

## Sources

- CVE List: [CVE-2026-40871](https://www.cve.org/CVERecord?id=CVE-2026-40871), CVE Terms of Use, modified 2026-04-21
- NVD: [CVE-2026-40871](https://nvd.nist.gov/vuln/detail/CVE-2026-40871), Public domain, modified 2026-10-26

---

Page: https://cve.day/CVE-2026-40871 · Whole record: https://cve.day/CVE-2026-40871.json · Rebuilt by cve.day 2026-11-25T22:59:19.135Z
