Skip to main content

mailcow: dockerized EUVDEUVD-2026-121240

| CVE-2026-125757 CRITICAL
Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336)
2026-11-10 VulnCheck GHSA-pg35-3wf2-cwx5
9.4
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

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

  1. Access
    Authenticate as domain admin of one domain
  2. Delivery
    Store Jinja os.execute macro via POST /api/v1/edit/domain/footer
  3. Exploit
    Send one authenticated outbound message from that domain
  4. Execution
    MOO_FOOTER renders footer, executing code in shared rspamd container
  5. Impact
    Read/modify/inject all tenants' mail and disable filtering platform-wide

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V1 - Encoding and Sanitization Template injection prevention
Exploitation Conditions

Requires an authenticated domain-administrator account for at least one hosted domain (the only access gate is hasDomainAccess()); no global/host admin, no network position, and no cross-site vector are needed because the admin stores the payload through their own normal session. Concretely: store a domain-wide footer whose HTML/plain contains a Jinja macro with an os.execute default value via POST /api/v1/edit/domain/footer, then trigger it with one authenticated outbound message from any mailbox in that domain, which causes rspamd's MOO_FOOTER prefilter to render the footer through lua_util.jinja_template (lupa). Limiting factors: exploitation is confined to principals holding domain-admin rights (PR:H) and requires the affected rendering path present before release 2026-11; the cross-tenant impact depends on the multi-tenant deployment model where rspamd is a single shared container. Note os.execute runs synchronously in the rspamd scan worker, so an unbounded command stalls all mail at DATA.

Impact

Signals align toward genuine priority rather than CVSS inflation. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:H/UI:N) describes network-reachable, low-complexity exploitation with no victim interaction, gated only by domain-administrator privilege, and the full scope-change impact (VC/VI/VA:H plus SC/SI/SA:H) is corroborated by the advisory's mechanism: rspamd is a single container shared across all tenants, so one tenant's domain admin reaches every tenant's mail. The vuln.today decision label is act_now and the finding comes from VulnCheck, reinforcing urgency. Tempering factors: PR:H means this is not an anonymous internet attack - it requires an authenticated domain-admin account, so the realistic threat model is a malicious or compromised tenant in a multi-tenant/hosting deployment, or privilege misuse, rather than mass opportunistic scanning. No EPSS score is provided and the CVE is not indicated as CISA KEV, so there is no evidence of widespread automated exploitation; a public PoC reference exists (VulnCheck advisory with a timing-oracle method) but it is not verified as working, drop-in exploit code. Net: high-confidence, high-impact cross-tenant RCE that warrants prompt patching, with the main real-world constraint being the domain-admin prerequisite.

Exploit ScenarioDerived

A domain administrator on a shared/multi-tenant mailcow instance stores a domain-wide footer containing a Jinja macro whose default value calls Lua os.execute (e.g. {% macro p(a=os.execute("sleep N")) %}{% endmacro %}), then sends a single authenticated outbound message from that domain. When rspamd's MOO_FOOTER prefilter renders the footer through lua_util.jinja_template, the macro default executes in the shared rspamd container, yielding arbitrary command execution as the _rspamd user across all tenants. A public PoC reference exists (VulnCheck) describing a blind timing-oracle confirmation via sleep; it is not verified as working exploit code, and output is not returned over SMTP.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.8% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Nov 10, 2026

Stored server-side template injection in mailcow: dockerized releases before 2026-11 lets an authenticated domain administrator run arbitrary commands inside the shared rspamd container, which in turn allows reading, modifying, and injecting every hosted tenant's mail in transit and disabling spam/AV filtering platform-wide. A domain-wide footer is stored verbatim and later rendered by rspamd's MOO_FOOTER prefilter through the lupa-backed Jinja engine, where a macro default value is evaluated by a bare load() and reaches os.execute in rspamd's real LuaJIT globals. The vendor has released a fix in the 2026-11 release; a public proof-of-concept reference exists (advisory steps using a bounded sleep as a timing oracle) but is not verified as working exploit code, and active exploitation is not confirmed in the supplied data. The vuln.today decision label is act_now.

RemediationAI

Vendor-released patch: upgrade to mailcow: dockerized 2026-11 or later (https://github.com/mailcow/mailcow-dockerized/releases/tag/2026-11). The fix commit e986803980db8b29435a2ddba5d9760737a818e3 removes the jinja_template call in data/conf/rspamd/lua/rspamd.local.lua and replaces it with an expand_footer() helper that only substitutes '{= key =}' placeholders via gsub, so footer content is treated as data and unknown placeholders render empty as before; applying that commit is the complete fix, and the advisory states it closes the entire chain, including the post-exploitation MC_CHANNEL/dockerapi container-restart amplifier. Until the upgrade is deployed, reduce exposure by auditing and clearing domain-wide footers (GET/POST /api/v1/edit/domain/footer) for every hosted domain and removing any Jinja syntax from stored footer HTML/plain values, and by restricting domain-administrator rights to principals who are trusted with code execution inside the shared rspamd container, since hasDomainAccess() is the only gate. Be aware that footer payloads execute synchronously in the rspamd scan worker: an unbounded command stalls all mail at DATA, and recovery requires 'docker compose restart rspamd-mailcow'; keep any verification payload bounded (sleep N / timeout N).

Affected VersionsENISA

mailcow: dockerized 0 <2026-11

Affected Packages

euvd mailcow_dockerized fix: 2026-11

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

The flaw is CWE-1336 server-side template injection that escalates to CWE-94 code injection. mailcow stores a domain-wide footer through functions.mailbox.inc.php (case 'domain_wide_footer', value assigned verbatim around line 4187 and INSERTed around line 4263), gated only by hasDomainAccess() and reachable via POST /api/v1/edit/domain/footer; data/conf/rspamd/dynmaps/footer.php serves that stored HTML to rspamd. The sink is rspamd.local.lua's MOO_FOOTER prefilter (line 769), which passed footer.html and footer.plain to lua_util.jinja_template (lines 847 and 850). The bundled contrib/lua-lupa/lupa.lua evaluates a macro default value with load('return '..default) without the sandbox environment (line 487; {% filter %} parameters at line 554), so the chunk executes in rspamd's real LuaJIT globals where os.execute is reachable - arbitrary command execution rather than string expansion. The advisory pins the affected tree at commit 55982ac74bfd35581cc44b122ab5fc659e3ae90a with rspamd 4.2.1-1, matching CPE cpe:2.3:a:mailcow:mailcow:_dockerized. Because rspamd is a single container shared across all tenants, code execution as _rspamd crosses tenant boundaries (scope change). A post-exploitation amplifier exists but is not an independent entry point: from inside rspamd the REDISPASS environment variable allows PUBLISH to MC_CHANNEL, which the dockerapi subscriber can turn into stop/start/restart of any container for a platform-wide denial of service; the advisory states the footer fix closes the whole chain, and the issue is not a host-level breakout. One operational detail from the advisory: os.execute runs synchronously in the rspamd scan worker, so an unbounded command wedges the scan pool and stalls all mail at DATA.

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 (VulnCheck) PRIMARY 9.4 CRITICAL
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
vuln.today AI 9.1 CRITICAL

Domain-admin account required (PR:H) but no victim interaction since the attacker sends the trigger message (UI:N); shared rspamd container yields scope change (S:C) with full C/I/A impact across tenants.

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

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

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

DescriptionCVE.org

mailcow: dockerized before 2026-11 contains a server-side template injection vulnerability that allows domain administrators to execute commands in the shared rspamd container by storing a malicious domain-wide footer. Attackers can embed a Jinja macro with an os.execute default value, rendered by the rspamd MOO_FOOTER prefilter, to read or inject mail for every tenant and disable filtering.

Technical POC Analysis

CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine, leading to CWE-94 code injection.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A critical stored template injection vulnerability in mailcow (dockerized releases before 2026-11) allows any authenticated domain administrator to execute arbitrary commands inside the shared rspamd container, compromising the confidentiality and integrity of all hosted tenants' email in transit and the platform's spam/AV filtering. This affects every tenant on a shared mailcow instance, not just the attacker's domain, and could lead to data breaches, mail tampering, and reputational harm. Leadership should care because a single malicious or compromised domain admin can undermine the entire managed email service.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.8%
Top 42% exploitable
Prevalence
Medium
popular self-hosted open-source mail suite, common among small orgs and hosters
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 CRITICAL
CISA KEV No
Public POC No
EPSS 0.8%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
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
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

48
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +47
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

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-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

CVE-2026-7460 HIGH
7.4 May 20

Stored cross-site scripting in the mailcow-dockerized administrator Queue Manager allows attackers who can influence Pos

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