← back
CVE-2026-22689

Mailpit is vulnerable to Cross-Site WebSocket Hijacking (CSWSH) allowing unauthenticated access to emails

CVSS 6.5 MEDIUMEPSS 0.2%CWE-1385
In short

Mailpit, an email testing tool, accepts WebSocket connections from any website without checking where the request comes from. An attacker can create a malicious website that secretly connects to a developer's local Mailpit instance to steal emails and server information.

Technical detail

Mailpit versions prior to 1.28.2 lack Origin header validation on WebSocket connections, enabling Cross-Site WebSocket Hijacking (CSWSH). An attacker can exploit this by hosting a malicious site that, when visited by a user running Mailpit locally, establishes an unauthorized WebSocket connection to ws://localhost:8025 to exfiltrate email contents, headers, and server statistics. The vulnerability requires user interaction (visiting the attacker's site) but no authentication.

Summary generated and translated by AI from the official description.
Mailpit is an email testing tool and API for developers. Prior to version 1.28.2, the Mailpit WebSocket server is configured to accept connections from any origin. This lack of Origin header validation introduces a Cross-Site WebSocket Hijacking (CSWSH) vulnerability. An attacker can host a malicious website that, when visited by a developer running Mailpit locally, establishes a WebSocket connection to the victim's Mailpit instance (default ws://localhost:8025). This allows the attacker to intercept sensitive data such as email contents, headers, and server statistics in real-time. This issue has been patched in version 1.28.2.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
Affected products
axllent · mailpit

Want to know if your infrastructure is exposed to this?

Talk to TrueHacking →