Cyber Resilience

CVE-2026-40871

SQLi

Published
21 April 2026
Modified
22 April 2026
CVSS Score v3.1 7.2
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.099 95th percentile
Risk Priority 62 floored blend · peak EPSS

Summary

CVE-2026-40871 is a high-severity Improper Input Validation (CWE-20) vulnerability. Its CVSS base score is 7.2 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Content Injection (T1659); ranked in the top 5% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

CVE-2026-40871 is a second-order SQL injection vulnerability affecting mailcow: dockerized, an open source groupware and email suite based on Docker. Versions prior to 2026-03b are vulnerable due to improper handling of the quarantine_category field in the Mailcow API. Specifically, the /api/v1/add/mailbox endpoint accepts and stores this field without validation or sanitization, and the value is later incorporated into SQL queries in quarantine_notify.py using unsafe % string formatting rather than parameterized queries.

An attacker with high privileges (PR:H per CVSS 3.1 score of 7.2) can exploit this by submitting a malicious quarantine_category value via the API. The injection occurs delayed during execution of the quarantine notification job, enabling arbitrary SQL execution. Attackers can use techniques like UNION SELECT to exfiltrate sensitive data, such as admin credentials, which gets rendered and exposed in quarantine notification emails.

The official GitHub security advisory (GHSA-r8fq-wrfm-cj2q) recommends upgrading to version 2026-03b, which addresses the issue by fixing the unsafe SQL query construction in quarantine_notify.py. No additional mitigations are detailed beyond the patch.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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…

more

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.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

T1659 Content Injection Initial Access
Adversaries may gain access and continuously communicate with victims by injecting malicious content into systems through online network traffic.
T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1036.001 Invalid Code Signature Stealth
Adversaries may attempt to mimic features of valid code signatures to increase the chance of deceiving a user, analyst, or tool.
T1059 Command and Scripting Interpreter Execution
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries.
T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
T1203 Exploitation for Client Execution Execution
Adversaries may exploit software vulnerabilities in client applications to execute code.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2024-4609Shared CWE-20, CWE-89
CVE-2023-25651Shared CWE-20, CWE-89
CVE-2024-4547Shared CWE-20, CWE-89
CVE-2024-4548Shared CWE-20, CWE-89
CVE-2023-39357Shared CWE-20, CWE-89
CVE-2024-31212Shared CWE-20, CWE-89
CVE-2024-5276Shared CWE-20, CWE-89
CVE-2023-22491Shared CWE-20, CWE-89
CVE-2024-32655Shared CWE-89
CVE-2024-27304Shared CWE-89

Affected Assets

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)
  • 6 hardening rules · 3 OS baselines
Validate
Prove the fix (OWASP ASVS)
  • V1.1.2
  • V1.2.1
  • V1.2.3
  • V6.2.5

Mitigating Controls (NIST 800-53 r5) AI

Developer testing and evaluation can discover missing input validation through analysis or test cases.

SI-10 directly requires validity checks on information inputs, structurally preventing improper or missing validation.

Requiring documented development standards and tools can embed input-validation practices into the engineering process.

Secure engineering principles require parameterized queries and input sanitization that structurally eliminate SQLi.

System monitoring can identify attempted SQLi exploitation via anomalous queries after the weakness exists.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

Secure SDLC practices directly require and enforce input validation during development.

PR.AT-02 partial match
prevents

Training raises developer awareness of SQLi risks and can reduce introduction likelihood (partial) but removes none of the actual coding flaw's risk by itself since technical neutralization is still required.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

prevents

Secure coding standards explicitly require correct output encoding and escaping to preserve message structure.

finds

Testing against a defined set of requirements and using code review plus vulnerability scanning forces validation of inputs and handling of unanticipated conditions, reducing the chance that malformed data will be accepted.

prevents

Early warnings and shared best-practice information help organizations apply the latest remediation techniques against SQL-injection vulnerabilities.

prevents

Threat-intelligence feeds that surface new SQL-injection campaigns enable rapid updates to query-construction defenses and detection signatures before exploitation occurs.

prevents

Secure-coding guidelines and mandatory security testing (including code scans) compel developers to validate and sanitize inputs at design and implementation time, lowering the incidence of malformed or malicious data reaching downstream components.

prevents

Mandating input controls that include integrity checks and input validation ensures that untrusted data is examined before use, blocking the root cause of many injection and malformed-data weaknesses.

Hardening callouts derived

Configuration rules from DISA STIG baselines that bear on weaknesses of the type cited by this CVE. Each rule is shown with the relationship its mapping actually records, against the CWE it was authored against. Derived via CVE→CWE over `controls_xwalks` (authoritative rows only; rows rated `none` are excluded).

RHEL 8 (1 rule)
  • V-230265 RHEL 8 must prevent the installation of software, patches, service packs, device drivers, or operating system components of local packages without verification they have been digitally signed using a certificate that is issued by a Certificate Authority (CA) that is recognized and approved by the organization. prevents CWE-20

References