CVE-2026-40878 mailcow-dockerized Login Page has Reflected Parameter Injection / Wrong-Context XSS Escaping

Low 2.1 Published Updated

Attackers can execute arbitrary JavaScript in the mailcow login page via reflected parameter injection, potentially leading to session hijacking or account takeover.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2026-40878?

CVE-2026-40878 is a low-severity cross-site scripting vulnerability in mailcow-dockerized, published on 21 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

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.

Weakness: CWE-79

Which versions are affected by CVE-2026-40878?

How do I fix CVE-2026-40878?

No fix has been published for CVE-2026-40878 yet. Limit exposure of the affected software until one is available.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-40878 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-40878 exists.

Public exploit code: 1 Nuclei template.

Sources

Also known as GHSA-xv9r-j862-5hqf.

Is CVE-2026-40878 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free