Skip to main content

mailcow-dockerized CVE-2026-40878

| EUVDEUVD-2026-24262 LOW
Cross-site Scripting (XSS) (CWE-79)
2026-04-21 GitHub_M
2.1
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft login URL with JS payload in query string
  2. Delivery
    Deliver URL via phishing to mailcow user
  3. Exploit
    Victim clicks link and loads login page
  4. Execution
    REQUEST_URI and GET params reflected into JS setLang() block
  5. Persist
    Arbitrary JavaScript executes in victim browser
  6. Impact
    Session token or credentials exfiltrated to attacker

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Output encoding, context-aware escaping
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that a victim user actively click a crafted URL pointing to the mailcow login page - user interaction is mandatory (UI:A in CVSS 4.0) and no attacker authentication is required (PR:N). The injection points are specifically the login page's language-switching UI and the setLang() JavaScript block within base.twig, meaning the attack surface is confined to the pre-authentication login page rather than authenticated internal pages. AT:P indicates specific attack prerequisites are present: the attacker must deliver a specially constructed URL and convince a user to visit it. Exploitation is not automatable per SSVC, as mass-triggering the XSS without per-victim social engineering is not viable. Limiting factors include: mandatory user interaction (defeats automated exploitation), scope limited to the victim's browser session rather than the server, and the attack is constrained to the login page context only - authenticated users browsing internal mailcow pages are not affected by the query_string() GET parameter reflection unless navigating back through the login URL.

Impact

The CVSS 4.0 score of 2.1 accurately reflects the constrained real-world risk: while the attack vector is network (AV:N) and no attacker privileges are required (PR:N), mandatory active user interaction (UI:A) and specific attack prerequisites (AT:P) significantly reduce exploitability. All three vulnerable-system impact metrics (VC:L/VI:L/VA:L) are Low, and subsequent-system impact is absent (SC:N/SI:N/SA:N), confirming this is a browser-scoped, session-level risk rather than a server-side compromise. EPSS at 0.05% (15th percentile) and SSVC exploitation status of 'none' with 'non-automatable' attack mode corroborate that this is not being leveraged at scale. The publicly available Nuclei template primarily enables detection scanning rather than weaponized exploitation. The practical risk concentrates on mailcow deployments serving high-value targets, where a phished admin click could yield session token theft or credential harvesting - SSVC's 'partial' technical impact is appropriate for this scope. There are no conflicting signals; all data sources consistently point to a low-priority, patch-when-convenient finding for most deployments.

Exploit ScenarioDerived

An attacker crafts a URL targeting the mailcow login page with a JavaScript payload embedded in a query parameter (e.g., https://mail.target.org/?lang=<injected>), then delivers it via a phishing email to a mailcow administrator or user. When the victim clicks the link, the login page renders the malicious parameter inside the JavaScript setLang() string literal without JS-context escaping, executing attacker-controlled code in the browser and potentially exfiltrating session tokens or initiating actions under the victim's identity. A publicly available Nuclei template at https://github.com/projectdiscovery/nuclei-templates/tree/main/http/cves/2026/CVE-2026-40878.yaml allows automated identification of vulnerable instances.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 24, 2026

Reflected XSS in mailcow-dockerized's login page (all versions prior to 2026-03b) allows a remote unauthenticated attacker to inject and execute arbitrary JavaScript in a victim's browser by delivering a crafted URL. The flaw stems from two compounding issues: the raw REQUEST_URI server variable is rendered inside a JavaScript string literal in base.twig using HTML-only escaping instead of JS-context escaping, and the query_string() helper propagates all $_GET parameters into language-switching links, preserving injected payloads across page navigation. A publicly available Nuclei detection template confirms the attack surface is known; however, SSVC lists exploitation as 'none' and EPSS at 0.05% indicates no observed widespread abuse at time of analysis.

RemediationAI

Upgrade mailcow-dockerized to version 2026-03b or later, which resolves the vulnerability by applying context-aware Twig JS escaping to REQUEST_URI in the setLang() JavaScript block and sanitizing $_GET parameter passthrough in the query_string() helper. The vendor advisory and patch details are at https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-xv9r-j862-5hqf. If immediate upgrade is not feasible, restrict access to the mailcow login page to trusted IP ranges via reverse proxy or firewall rules - this reduces the attack surface for external phishing-driven exploitation but does not protect against threats originating from trusted networks. Additionally, deploying a strict Content Security Policy header (e.g., script-src 'self') on the mailcow web interface would limit injected script execution; note this may require testing against legitimate mailcow UI behavior as CSP can interfere with inline script usage elsewhere in the application.

Affected VersionsENISA

mailcow-dockerized < 2026-03b

Affected Packages

euvd mailcow_dockerized fix: 2026-03b

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

mailcow-dockerized (CPE: cpe:2.3:a:mailcow:mailcow-dockerized:*:*:*:*:*:*:*:*) is a Docker-based open-source email and groupware platform using PHP and the Twig templating engine. The root cause (CWE-79: Improper Neutralization of Input During Web Page Generation) arises in two places within base.twig: first, $_SERVER['REQUEST_URI'] is injected as a global Twig template variable and embedded directly inside a JavaScript string literal within the setLang() helper, where Twig's default HTML auto-escaping is insufficient - it does not neutralize JS-breaking characters such as backslashes, unescaped quotes, or newlines that could close the string context and inject executable code; second, the query_string() Twig helper blindly merges all current $_GET parameters into language-switching anchor links on the login page, expanding the reflection surface and allowing an attacker's payload to persist across language-toggle navigation without re-delivery. The fix in 2026-03b applies the appropriate |escape('js') Twig filter in the JavaScript context and sanitizes $_GET passthrough in the helper.

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

Vendor (GitHub_M) PRIMARY 2.1 LOW
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N
vuln.today AI 6.1 MEDIUM

Reflected XSS over network with no auth needed (PR:N), mandatory user click (UI:R), browser scope change (S:C), low confidentiality and integrity impact, no availability impact.

3.1 AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

4
Patch released
Apr 22, 2026 - 21:02 nvd
Patch available
Patch available
Apr 21, 2026 - 21:02 EUVD
CVSS changed
Apr 21, 2026 - 20:22 NVD
2.1 (LOW)
CVE Published
Apr 21, 2026 - 19:21 nvd
LOW 2.1

DescriptionCVE.org

mailcow: dockerized is an open source groupware/email suite based on docker. In versions prior to 2026-03b, the mailcow web interface passes the raw $_SERVER['REQUEST_URI'] to Twig as a global template variable and renders it inside a JavaScript string literal in the setLang() helper of base.twig, relying on Twig's default HTML auto-escaping instead of the context-appropriate js escaping strategy. In addition, the query_string() Twig helper merges all current $_GET parameters into the language-switching links on the login page, so attacker-supplied parameters are reflected and preserved across navigation. Version 2026-03b fixes the vulnerability.

Threat Intelligence Overview

EPSS Score
0.0%
Top 85% exploitable
Prevalence
Low
niche self-hosted open-source email suite, limited enterprise deployment footprint
Exploit
POC
Public exploit code exists
Data Quality
6 sources
Confidence: High

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.

SignalValue
Severity LOW
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Low
Technical Impact
Partial

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +10
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

CVE-2017-8928 HIGH POC
8.8 May 14

mailcow 0.14, as used in "mailcow: dockerized" and other products, has CSRF. Rated high severity (CVSS 8.8), this vulner

CVE-2023-26490 HIGH POC
8.8 Mar 04

mailcow is a dockerized email package, with multiple containers linked in one bridged network. Rated high severity (CVSS

CVE-2022-31138 HIGH POC
8.8 Jul 11

mailcow is a mailserver suite. Rated high severity (CVSS 8.8), this vulnerability is remotely exploitable, low attack co

CVE-2022-31245 HIGH POC
8.8 May 20

mailcow before 2022-05d allows a remote authenticated user to inject OS commands and escalate privileges to domain admin

CVE-2022-39258 HIGH POC
8.2 Sep 27

mailcow is a mailserver suite. Rated high severity (CVSS 8.2), this vulnerability is remotely exploitable, no authentica

CVE-2025-25198 HIGH POC
7.1 Feb 12

mailcow: dockerized is an open source groupware/email suite based on docker. Rated high severity (CVSS 7.1), this vulner

CVE-2024-30270 MEDIUM POC
6.2 Apr 04

mailcow: dockerized is an open source groupware/email suite based on docker. Rated medium severity (CVSS 6.2), this vuln

CVE-2024-31204 MEDIUM POC
6.1 Apr 04

mailcow: dockerized is an open source groupware/email suite based on docker. Rated medium severity (CVSS 6.1). Public ex

CVE-2026-125757 CRITICAL
9.4 Nov 10

Stored server-side template injection in mailcow: dockerized releases before 2026-11 lets an authenticated domain admini

CVE-2026-40872 CRITICAL
9.3 Apr 21

Stored cross-site scripting in mailcow dockerized versions before 2026-03b enables remote attackers to execute arbitrary

CVE-2026-40873 HIGH
8.9 Apr 21

Stored cross-site scripting (XSS) in mailcow: dockerized (versions prior to 2026-03b) allows remote unauthenticated atta

CVE-2023-34108 HIGH
8.8 Jun 07

mailcow is a mail server suite based on Dovecot, Postfix and other open source software, that provides a modern web UI f

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy