Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconObtain high-privilege API credentials
-
DeliverySend crafted POST to /api/v1/add/mailbox with SQL payload
-
ExploitMalicious quarantine_category stored in database
-
InstallWait for scheduled quarantine_notify.py execution
-
C2SQL injection triggers during notification job
-
ExecuteUNION SELECT extracts admin credentials
-
ImpactSensitive data exfiltrated via notification email
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V2 - Validation and Business Logic Input validation, allowlisting
|
| Exploitation Conditions | Requires authenticated API access with high privileges (PR:H from CVSS vector) to the Mailcow API, specifically the ability to create or modify mailboxes via the /api/v1/add/mailbox endpoint. The attacker must have credentials for an account with administrative or mailbox creation permissions. Exploitation is network-based (AV:N) with low complexity (AC:L), meaning no special network positioning or timing requirements beyond API access. The vulnerable code path activates only when the quarantine_notify.py scheduled job runs, requiring the mailcow instance to have quarantine notifications enabled (default configuration). The delayed execution nature means exploitation depends on the notification job schedule, typically periodic (hourly or daily). No user interaction required (UI:N) after initial API call. The attack succeeds against default mailcow configurations where quarantine notifications are active and input validation has not been manually implemented. |
| Impact | The CVSS 3.1 score of 7.2 (High) reflects the severe potential impact with network-based attack vector (AV:N), low complexity (AC:L), but requires high privileges (PR:H) and no user interaction (UI:N). The vector indicates complete compromise potential across confidentiality, integrity, and availability (C:H/I:H/A:H). Real-world risk assessment reveals moderate-to-high priority: while the PR:H requirement significantly limits the attack surface to authenticated API users with elevated permissions (typically administrators or service accounts), the delayed execution nature makes detection difficult since the injection occurs asynchronously during scheduled job runs rather than during the initial API call. No EPSS score provided and no CISA KEV listing indicates no confirmed widespread exploitation. The GitHub security advisory disclosure suggests responsible disclosure and timely vendor response. Primary risk scenarios include compromised admin accounts, malicious insiders, or service account credential theft. The ability to exfiltrate admin credentials via UNION SELECT creates a privilege escalation pathway where initial high-privilege access can be leveraged to extract and persist additional administrative credentials through automated email channels, potentially evading traditional security monitoring focused on API responses rather than email content. |
| Exploit ScenarioDerived | An attacker who has compromised high-privilege API credentials (or a malicious insider with administrative access) crafts a malicious API request to /api/v1/add/mailbox, setting the quarantine_category field to a SQL injection payload such as: "' UNION SELECT username, password, '' FROM admin WHERE '1'='1". This value is stored in the database without triggering immediate errors. Hours or days later, when the scheduled quarantine_notify.py job executes to send quarantine notifications, it retrieves the malicious quarantine_category value and incorporates it into a SQL query using unsafe string formatting. The UNION SELECT executes, extracting admin usernames and password hashes from the admin table, which are then rendered directly into the body of quarantine notification emails sent to the attacker-controlled mailbox. The attacker receives credentials via email, avoiding detection mechanisms focused on API response monitoring. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 21, 2026
Second-order SQL injection in mailcow: dockerized versions prior to 2026-03b allows authenticated API users with high privileges to execute arbitrary SQL commands through the quarantine notification system. Attackers inject malicious SQL via the quarantine_category field in /api/v1/add/mailbox endpoint, which executes when quarantine_notify.py runs its scheduled job, enabling data exfiltration of admin credentials and sensitive information through UNION-based queries rendered in notification emails. No public exploit code or active exploitation confirmed at time of analysis, with vendor patch available in version 2026-03b.
RemediationAI
Upgrade immediately to mailcow: dockerized version 2026-03b or later, which addresses the SQL injection vulnerability by implementing proper input validation and parameterized queries in the quarantine notification system. Follow the vendor security advisory at https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-r8fq-wrfm-cj2q for upgrade procedures specific to containerized deployments. As compensating controls until patching is complete, implement strict API access controls by auditing and restricting high-privilege API credentials to only essential service accounts, enable comprehensive API request logging for the /api/v1/add/mailbox endpoint to detect suspicious quarantine_category values, and review existing mailbox configurations for anomalous quarantine_category entries that may contain SQL injection payloads (look for SQL keywords like UNION, SELECT, or special characters in stored values). Consider temporarily disabling automated quarantine notifications via quarantine_notify.py if immediate patching is not feasible, though this will impact legitimate quarantine management workflows. After upgrading, rotate all administrative and API credentials as a precautionary measure given the credential exfiltration capabilities of this vulnerability.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
This vulnerability affects mailcow: dockerized (cpe:2.3:a:mailcow:mailcow-dockerized), a containerized open-source groupware and email suite. The flaw stems from CWE-20 (Improper Input Validation) manifesting as a second-order SQL injection. Unlike traditional SQL injection where malicious input is immediately executed, second-order SQL injection occurs when untrusted data is stored in the database and later retrieved and used in dynamically constructed SQL queries. The vulnerable code path involves the Mailcow API's /api/v1/add/mailbox endpoint accepting quarantine_category values without validation or parameterization, storing them directly. Subsequently, the quarantine_notify.py script retrieves these values and incorporates them into SQL queries using Python's unsafe % string formatting (string interpolation) rather than parameterized queries or prepared statements. When the scheduled quarantine notification job executes, the stored malicious SQL payload is injected into the query context, enabling UNION SELECT operations that can extract arbitrary data from the database and embed it in outgoing email notifications.
Know when Mailcow gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Primary rating from Vendor (GitHub_M) · only source for this CVE.
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
3DescriptionCVE.org
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.
Executive ViewAI
CVE-2026-40871 is a high-severity second-order SQL injection vulnerability in mailcow that allows authenticated administrators to extract sensitive data including credentials through the quarantine notification system. Organizations running mailcow versions prior to 2026-03b face risk of unauthorized access to email infrastructure and credential compromise if administrative accounts are compromised or insider threats exist.
Vendor-released patch: mailcow version 2026-03b. Until patched, restrict /api/v1/add/mailbox API access to minimal set of trusted administrators, disable or monitor quarantine_notify.py scheduled task execution, and implement API request logging with alerts for quarantine_category field injection patterns.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
mailcow 0.14, as used in "mailcow: dockerized" and other products, has CSRF. Rated high severity (CVSS 8.8), this vulner
mailcow is a dockerized email package, with multiple containers linked in one bridged network. Rated high severity (CVSS
mailcow is a mailserver suite. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, low attack co
mailcow before 2022-05d allows a remote authenticated user to inject OS commands and escalate privileges to domain admin
mailcow is a mailserver suite. Rated high severity (CVSS 8.2), this vulnerability is remotely exploitable, no authentica
mailcow: dockerized is an open source groupware/email suite based on docker. Rated high severity (CVSS 7.1), this vulner
mailcow: dockerized is an open source groupware/email suite based on docker. Rated medium severity (CVSS 6.2), this vuln
mailcow: dockerized is an open source groupware/email suite based on docker. Rated medium severity (CVSS 6.1). Public ex
Stored server-side template injection in mailcow: dockerized releases before 2026-11 lets an authenticated domain admini
Stored cross-site scripting in mailcow dockerized versions before 2026-03b enables remote attackers to execute arbitrary
Stored cross-site scripting (XSS) in mailcow: dockerized (versions prior to 2026-03b) allows remote unauthenticated atta
mailcow is a mail server suite based on Dovecot, Postfix and other open source software, that provides a modern web UI f
EUVD-2026-24253
NVD
CVE.org
EPSS
Vulnrichment
GitHub
Exploit-DB