{"id":"CVE-2026-67448","aliases":["CVE-2026-67448","GHSA-8r62-w5wh-fc5m","GO-2026-6271"],"related":[],"kind":"vulnerability","state":"published","title":"Mailpit: WebSocket origin check bypass via percent-encoded path (regression of CVE-2026-22689)","summary":"Mailpit is an email testing tool and API for developers. From 1.29.0 until 1.30.6, Mailpit's server/server.go origin middleware checks the raw RequestURI for the /api/ prefix while Go's ServeMux routes using the percent-decoded URL path, and server/websockets/client.go configures websocket.Upgrader.CheckOrigin to return true. A malicious website can request /%61pi/events, skip corsOriginAccessControl(), reach the /api/events WebSocket handler, and receive live message IDs, Message-Id values, sender and recipient fields, subjects, tags, and body snippets from an unauthenticated default Mailpit instance after the user visits the site. This is a regression of the earlier WebSocket origin protection and does not affect deployments protected by --ui-auth-file. This issue is fixed in version 1.30.6.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Mailpit is an email testing tool and API for developers. From 1.29.0 until 1.30.6, Mailpit's server/server.go origin middleware checks the raw RequestURI for the /api/ prefix while Go's ServeMux routes using the percent-decoded URL path, and server/websockets/client.go configures websocket.Upgrader.CheckOrigin to return true. A malicious website can request /%61pi/events, skip corsOriginAccessControl(), reach the /api/events WebSocket handler, and receive live message IDs, Message-Id values, sender and recipient fields, subjects, tags, and body snippets from an unauthenticated default Mailpit instance after the user visits the site. This is a regression of the earlier WebSocket origin protection and does not affect deployments protected by --ui-auth-file. This issue is fixed in version 1.30.6.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe cross-site WebSocket hijacking fix was reimplemented as an origin check gated on a raw-URI prefix test, but Go's ServeMux routes on the percent-decoded path, so requesting /%61pi/events reaches the WebSocket handler while skipping the only origin control, and the upgrader itself accepts every origin. Confirmed at HEAD 408b30d. Affects 1.29.0 through 1.30.5.\n\n## The defect\n\nTwo halves that were each correct in isolation. server/websockets/client.go accepts any origin and delegates the check elsewhere:\n\n```go\nvar upgrader = websocket.Upgrader{                       // line 33\n    ...\n    CheckOrigin: func(_ *http.Request) bool {            // line 37\n        // origin is checked via server.go's CORS settings\n        return true                                      // line 39\n    },\n}\n```\n\nserver/server.go performs that check but keys it on the RAW request target:\n\n```go\nif strings.HasPrefix(r.RequestURI, config.Webroot+\"api/\") || htmlPreviewRouteRe.MatchString(r.RequestURI) {   // line 320\n    if allowed := corsOriginAccessControl(r); !allowed {\n        http.Error(w, \"Blocked due to CORS violation\", http.StatusForbidden)\n        return\n    }\n```\n\nr.RequestURI is the untouched wire target; Go's ServeMux routes on the percent-DECODED path. So for /%61pi/events: `strings.HasPrefix(\"/%61pi/events\", \"/api/\")` is FALSE (origin check skipped), ServeMux decodes %61 to \"a\" and routes to /api/events, and the upgrader's CheckOrigin returns true.\n\nMeasured, default config, no auth: /api/events with `Origin: https://evil.example` returns 403; /%61pi/events with the same Origin returns 101 Switching Protocols and begins streaming. With a message delivered over SMTP while the cross-origin socket was open, the attacker origin received the ID, Message-Id, From, To, Cc, Bcc, Subject (\"SECRET password reset token abc123\"), size, tags, and body Snippet, live. WebSockets are not subject to CORS response-header enforcement, so the absent Access-Control-Allow-Origin header provides no protection once the upgrade succeeds.\n\nRegression provenance: commit 6f1f4f3 (2026-01-10, v1.28.2) fixed CVE-2026-22689 by DELETING CheckOrigin; commit a63bcd9 (2026-01-31, first in v1.29.0) reintroduced CheckOrigin returning true and replaced the protection with the bypassable raw-prefix test.\n\n## Attacker model and verification\n\nAny website the developer visits while Mailpit is running. No credentials, no ability to send mail, no interaction beyond visiting a page. Requires Mailpit without --ui-auth-file (the default, and the same precondition as the original CVE). The bypass was measured live against a real Mailpit instance on loopback, including the 403-versus-101 control pair; authentication still holds (the encoded path returns 401 when --ui-auth-file is set); browser reachability was confirmed against the WHATWG URL parser, which preserves %61.\n\n## Suggested fix\n\nDo not make security decisions on r.RequestURI. Key the check on r.URL.Path, the decoded value the router uses, so the gate and the route agree. Better, restore a real CheckOrigin on the upgrader so the WebSocket carries its own origin enforcement rather than depending on a middleware prefix match. Secondary (Low, not claimed as XSS): server/apiv1/message.go lines 154-155 echo an attacker-chosen Content-Type with Content-Disposition: inline; this is blocked today by the nonce CSP.\n\n## Tooling\n\nI used AI assistance while investigating. The bypass was measured live against a real Mailpit instance on loopback, including the 403-versus-101 control pair and the authenticated 401 case, and I separately confirmed at HEAD the CheckOrigin returning true with its delegating comment and the RequestURI-keyed prefix gate.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Mailpit: WebSocket origin check bypass via percent-encoded path (regression of CVE-2026-22689) in github.com/axllent/mailpit","format":"markdown","source":"go"},{"lang":"es","text":"Mailpit es una herramienta de prueba de correo electrónico y una API para desarrolladores. Desde la versión 1.29.0 hasta la 1.30.6, el middleware de origen server/server.go de Mailpit verifica la RequestURI sin procesar en busca del prefijo /api/ mientras que el ServeMux de Go enruta utilizando la ruta URL decodificada por porcentaje, y server/websockets/client.go configura websocket.Upgrader.CheckOrigin para devolver verdadero. Un sitio web malicioso puede solicitar /%61pi/events, omitir corsOriginAccessControl(), alcanzar el gestor WebSocket /api/events y recibir IDs de mensajes en vivo, valores de Message-Id, campos de remitente y destinatario, asuntos, etiquetas y fragmentos de cuerpo de una instancia predeterminada de Mailpit no autenticada después de que el usuario visita el sitio. Esto es una regresión de la protección de origen WebSocket anterior y no afecta a las implementaciones protegidas por --ui-auth-file. Este problema está solucionado en la versión 1.30.6.","source":"nvd"}],"published":"2026-08-20T21:29:06.185Z","modified":"2026-10-18T20:10:00.110Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-177","CWE-200","CWE-346"],"affected":[{"ranges":[{"version":">= 1.29.0, < 1.30.6","status":"affected"}],"vendor":"axllent","product":"mailpit","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.29.0","status":"affected","fixed":"1.30.6"}],"ecosystem":"Go","package":"github.com/axllent/mailpit","purl":"pkg:golang/github.com/axllent/mailpit","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"1.29.0","status":"affected","fixed":"1.30.6"}],"ecosystem":"Go","package":"github.com/axllent/mailpit","purl":"pkg:golang/github.com/axllent/mailpit","source":"go"}],"references":[{"url":"https://github.com/axllent/mailpit/security/advisories/GHSA-8r62-w5wh-fc5m","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/axllent/mailpit/commit/fbe5e006c3f1682b819df58b4a932d7a84920be9","tags":["fix","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/axllent/mailpit/releases/tag/v1.30.6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-67448","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/axllent/mailpit","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-08-21T11:31:14.259Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-67448","url":"https://www.cve.org/CVERecord?id=CVE-2026-67448","licence":"CVE Terms of Use","modified":"2026-08-21T11:31:27.439Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8r62-w5wh-fc5m","url":"https://github.com/advisories/GHSA-8r62-w5wh-fc5m","licence":"CC-BY-4.0","modified":"2026-09-02T23:45:04.677Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6271","url":"https://pkg.go.dev/vuln/GO-2026-6271","licence":"CC-BY-4.0","modified":"2026-08-26T01:19:26.047Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-67448","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-67448","licence":"Public domain","modified":"2026-10-18T20:10:00.110Z"}],"updatedAt":"2026-11-25T22:59:34.742Z","epss":{"score":0.00146,"percentile":0.04066,"date":"2026-12-02T12:00:21.000Z"}}