CVE-2026-22689: Github.com/axllent/mailpit Mailpit Is Vulnerable To Cross-Site Vulnerability

MODERATE
Advisory Identifier: GHSA-524m-q5m7-79mm
CVSS 6.5
CWE-1385
Published
Advisory Summary

CVE-2026-22689 is a MODERATE (CVSS 6.5) mailpit is vulnerable to cross-site vulnerability (CWE-1385: Missing Origin Validation in WebSockets) affecting Github.com/axllent/mailpit libraries in the Go ecosystem. The issue involves mailpit is vulnerable to cross-site websocket hijacking (cswsh) allowing unauthenticated access to emails. Remediation is available by upgrading affected packages to version 1.28.2, 0.0.0-20260110031614.

CVE-2026-22689 at a Glance

CVE Identifier CVE-2026-22689
GHSA Identifier GHSA-524m-q5m7-79mm
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-1385: Missing Origin Validation in WebSockets
Affected Product Github.com/axllent/mailpit
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-22689

To remediate this vulnerability, upgrade all affected Github.com/axllent/mailpit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/axllent/mailpit fixed: 1.28.2
Upgrade github.com/axllent/mailpit to 1.28.2
github.com/axllent/mailpit fixed: 0.0.0-20260110031614
Upgrade github.com/axllent/mailpit to 0.0.0-20260110031614
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/axllent/mailpit

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-22689, inspect your project dependencies for Github.com/axllent/mailpit:

inspect dependencies for github.com/axllent/mailpit

Analyze the terminal output to locate any version of Github.com/axllent/mailpit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.28.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1385: Missing Origin Validation in WebSockets, where the product uses a websocket, but it does not properly verify that the source of data or communication is valid. In Github.com/axllent/mailpit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**Summary** 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. **Vulnerable Code** The vulnerability exists in server/websockets/client.go where the CheckOrigin function is explicitly set to return true for all requests, bypassing standard Same-Origin Policy (SOP) protections provided by the gorilla/websocket library. https://github.com/axllent/mailpit/blob/877a9159ceeaf380d5bb0e1d84017b24d2e7b361/server/websockets/client.go#L34-L39 **Impact** This vulnerability impacts the Confidentiality of the data stored in or processed by Mailpit. Although Mailpit is often used as a local development tool, this vulnerability allows remote exploitation via a web browser. - **Scenario**: A developer has Mailpit running at localhost:8025. - **Trigger**: The developer visits a malicious website (or a compromised legitimate site) in the same browser. - **Exploitation**: The malicious site's JavaScript initiates a WebSocket connection to ws://localhost:8025/api/events. Since the origin check is disabled, the browser allows this cross-origin connection. - **Data Leak**: The attacker receives all broadcasted events, including full email details (subjects, sender/receiver info) and server metrics. **Attack Impact** - Real-time notification of new emails - Email metadata (sender, subject, recipients) - Mailbox statistics - All WebSocket broadcast data **Recommended Fix** The `CheckOrigin` function should be removed to allow gorilla/websocket to enforce its default safe behavior (checking that the Origin matches the Host). Alternatively, strict validation logic should be implemented. **Proposed Change (Remove unsafe check):** ```go var upgrader = websocket.Upgrader{ ReadBufferSize: 1024, WriteBufferSize: 1024, // CheckOrigin: func(r *http.Request) bool { return true }, // REMOVED EnableCompression: true, } ``` **Proof of Concept (PoC)**: To reproduce this vulnerability: - Start Mailpit (default settings). - Save the following HTML code as poc.html and serve it from a different origin (e.g., using python http.server on port 8000 or opening it directly as a file). - Open the [poc_websocket_hijack.html](https://github.com/user-attachments/files/24522726/poc_websocket_hijack.html) file in your browser. - Send a test email to Mailpit or perform any action in the Mailpit UI. - Observe that the "malicious" page successfully receives the event data.

CVE-2026-22689 Affected Github.com/axllent/mailpit Versions

2 component(s)
Fixed Versions:
1.28.20.0.0-20260110031614
Product / Package Ecosystem Affected Versions Fixed Version
github.com/axllent/mailpit
Go
≥ 1.2.6
< 1.28.2
1.28.2
github.com/axllent/mailpit
Go
< 0.0.0-20260110031614
0.0.0-20260110031614

References

Frequently Asked Questions

What is CVE-2026-22689?
CVE-2026-22689 is a security vulnerability in Github.com/axllent/mailpit involving Mailpit is vulnerable to Cross-Site WebSocket Hijacking (CSWSH) allowing unauthenticated access to emails under CWE-1385: Missing Origin Validation in WebSockets.
Which Github.com/axllent/mailpit versions are affected?
Affected versions include releases prior to 1.28.2, 0.0.0-20260110031614 across affected packages: github.com/axllent/mailpit.
What version fixes CVE-2026-22689?
Upgrading to 1.28.2, 0.0.0-20260110031614 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/axllent/mailpit affected?
Yes, github.com/axllent/mailpit is affected in releases prior to 1.28.2, 0.0.0-20260110031614. Upgrade your dependency to 1.28.2, 0.0.0-20260110031614 or later.
What is the CVSS score of CVE-2026-22689?
CVE-2026-22689 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-22689?
CVE-2026-22689 is classified under CWE-1385: Missing Origin Validation in WebSockets (The product uses a WebSocket, but it does not properly verify that the source of data or communication is valid.).
How can I check Go dependencies for CVE-2026-22689?
Run the dependency tree command: 'inspect dependencies for github.com/axllent/mailpit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-524m-q5m7-79mm",
  "modified" : "2026-01-13T15:11:42Z",
  "published" : "2026-01-13T15:11:42Z",
  "aliases" : [ "CVE-2026-22689" ],
  "summary" : "Mailpit is vulnerable to Cross-Site WebSocket Hijacking (CSWSH) allowing unauthenticated access to emails",
  "details" : "**Summary**\nThe 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.\n\nAn 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.\n\n**Vulnerable Code**\nThe vulnerability exists in server/websockets/client.go where the CheckOrigin function is explicitly set to return true for all requests, bypassing standard Same-Origin Policy (SOP) protections provided by the gorilla/websocket library.\n\nhttps://github.com/axllent/mailpit/blob/877a9159ceeaf380d5bb0e1d84017b24d2e7b361/server/websockets/client.go#L34-L39\n\n**Impact**\nThis vulnerability impacts the Confidentiality of the data stored in or processed by Mailpit.\nAlthough Mailpit is often used as a local development tool, this vulnerability allows remote exploitation via a web browser.\n\n- **Scenario**: A developer has Mailpit running at localhost:8025.\n- **Trigger**: The developer visits a malicious website (or a compromised legitimate site) in the same browser.\n- **Exploitation**: The malicious site's JavaScript initiates a WebSocket connection to ws://localhost:8025/api/events. Since the origin check is disabled, the browser allows this cross-origin connection.\n- **Data Leak**: The attacker receives all broadcasted events, including full email details (subjects, sender/receiver info) and server metrics.\n\n**Attack Impact**\n- Real-time notification of new emails\n- Email metadata (sender, subject, recipients)\n- Mailbox statistics\n- All WebSocket broadcast data\n\n**Recommended Fix**\nThe `CheckOrigin` function should be removed to allow gorilla/websocket to enforce its default safe behavior (checking that the Origin matches the Host). Alternatively, strict validation logic should be implemented.\n\n**Proposed Change (Remove unsafe check):**\n\n```go\nvar upgrader = websocket.Upgrader{\n    ReadBufferSize:    1024,\n    WriteBufferSize:   1024,\n    // CheckOrigin: func(r *http.Request) bool { return true }, // REMOVED\n    EnableCompression: true,\n}\n```\n\n**Proof of Concept (PoC)**: To reproduce this vulnerability:\n\n- Start Mailpit (default settings).\n- Save the following HTML code as poc.html and serve it from a different origin (e.g., using python http.server on port 8000 or opening it directly as a file).\n- Open the [poc_websocket_hijack.html](https://github.com/user-attachments/files/24522726/poc_websocket_hijack.html) file in your browser.\n- Send a test email to Mailpit or perform any action in the Mailpit UI.\n- Observe that the \"malicious\" page successfully receives the event data.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/axllent/mailpit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.6"
      }, {
        "fixed" : "1.28.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/axllent/mailpit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20260110031614"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/axllent/mailpit/security/advisories/GHSA-524m-q5m7-79mm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-22689"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/axllent/mailpit/commit/6f1f4f34c98989fd873261018fb73830b30aec3f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/axllent/mailpit"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1385" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-13T15:11:42Z",
    "nvd_published_at" : "2026-01-10T06:15:51Z"
  }
}