{"id":"CVE-2025-12421","published":"2025-11-27T17:47:04Z","modified":"2026-02-26T16:07:25Z","title":"Account Takeover via Code Exchange Endpoint","vendor":"Mattermost","product":"Mattermost","tier":"tail","description":{"text":"Mattermost versions 11.0.x <= 11.0.2, 10.12.x <= 10.12.1, 10.11.x <= 10.11.4, 10.5.x <= 10.5.12 fail to to verify that the token used during the code exchange originates from the same authentication flow, which allows an authenticated user to perform account takeover via a specially crafted email address used when switching authentication methods and sending a request to the /users/login/sso/code-exchange endpoint. The vulnerability requires ExperimentalEnableAuthenticationTransfer to be enabled (default: enabled) and RequireEmailVerification to be disabled (default: disabled).","provenance":"source","from":"CVE.org"},"cvss":{"score":9.9,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00446,"percentile":0.39629,"provenance":"source"},"cwes":[{"id":"CWE-303","name":"Incorrect Implementation of Authentication Algorithm"}],"references":[{"url":"https://mattermost.com/security-updates","tags":[]}],"priority":{"score":14.9,"factors":[{"name":"EPSS percentile","points":7.93},{"name":"CVSS severity","points":6.93}]},"vendorSlug":"mattermost","affectedVersions":[{"vendor":"Mattermost","product":"Mattermost","versions":[">= 11.0.0, <= 11.0.2",">= 10.12.0, <= 10.12.1",">= 10.11.0, <= 10.11.4",">= 10.5.0, <= 10.5.12"]}],"fixedVersions":[{"vendor":"Mattermost","product":"Mattermost","versions":["11.1.0","11.0.3","10.12.2","10.11.5","10.5.13"]}],"solutions":{"items":["Update Mattermost to versions 11.1.0, 11.0.3, 10.12.2, 10.11.5, 10.5.13 or higher."],"from":"CVE.org CNA","provenance":"source"},"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2025-12-02T04:55:57.705451Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Go","package":"github.com/mattermost/mattermost/server/v8","vulnerableRanges":["<8.0.0-20251022210333-acda1fb5dd46"],"patched":["8.0.0-20251022210333-acda1fb5dd46"],"from":["GHSA-mp6x-97xj-9x62","GO-2025-4170"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/mattermost/mattermost-server","vulnerableRanges":[">=11.0.0, <11.0.3",">=10.12.0, <10.12.2",">=10.11.0, <10.11.5",">=10.5.0, <10.5.13","all versions"],"patched":["11.0.3","10.12.2","10.11.5","10.5.13"],"from":["GHSA-mp6x-97xj-9x62","GO-2025-4170"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/mattermost/mattermost-server/v5","vulnerableRanges":["all versions"],"patched":[],"from":["GO-2025-4170"],"provenance":"source"},{"ecosystem":"Go","package":"github.com/mattermost/mattermost-server/v6","vulnerableRanges":["all versions"],"patched":[],"from":["GO-2025-4170"],"provenance":"source"}],"euvd":{"id":"EUVD-2025-199833","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-mattermost-cve-2023-5969","parents":[{"from":"CVE-2025-11794","to":"CVE-2025-12421","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"Go:github.com/mattermost/mattermost-server","fromFixed":"10.12.1+incompatible","toFixed":"10.12.2","daysApart":13},{"kind":"same-code","provenance":"machine","files":["server/channels/store/retrylayer/retrylayer.go","server/channels/store/sqlstore/tokens_store.go","server/channels/store/store.go","server/channels/store/storetest/mocks/TokenStore.go","server/channels/store/timerlayer/timerlayer.go"],"commits":["https://github.com/mattermost/mattermost/commit/375ce229f4923205394d8f27925372b2cbf28130","https://github.com/mattermost/mattermost/commit/6c288aa62bb3343183ec1d0a06360d14aa0193e9","https://github.com/mattermost/mattermost/commit/5072bbf689a46b3b97b2373f26149f5891396e6b","https://github.com/mattermost/mattermost/commit/acda1fb5dd46a2f46c76ae67012423c760525eaa"],"basis":"shared function","functions":["Cleanup","GetByToken","GetTokenById"]}]},{"from":"CVE-2025-55073","to":"CVE-2025-12421","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["server/channels/store/retrylayer/retrylayer.go","server/channels/store/sqlstore/tokens_store.go","server/channels/store/store.go","server/channels/store/storetest/mocks/TokenStore.go","server/channels/store/timerlayer/timerlayer.go"],"commits":["https://github.com/mattermost/mattermost/commit/5072bbf689a46b3b97b2373f26149f5891396e6b","https://github.com/mattermost/mattermost/commit/acda1fb5dd46a2f46c76ae67012423c760525eaa","https://github.com/mattermost/mattermost/commit/375ce229f4923205394d8f27925372b2cbf28130","https://github.com/mattermost/mattermost/commit/6c288aa62bb3343183ec1d0a06360d14aa0193e9"],"basis":"shared function","functions":["Cleanup","GetByToken","GetTokenById"]}]}],"packageHistory":[{"cve":"CVE-2025-11794","published":"2025-11-14","fixed":"10.12.1+incompatible","kev":false},{"cve":"CVE-2025-55073","published":"2025-11-14","fixed":"10.12.1+incompatible","kev":false},{"cve":"CVE-2025-41436","published":"2025-11-14","fixed":"11.0.0-alpha.1+incompatible","kev":false},{"cve":"CVE-2025-12421","published":"2025-11-27","fixed":"11.0.3","kev":false},{"cve":"CVE-2025-12559","published":"2025-11-27","fixed":"11.0.3","kev":false},{"cve":"CVE-2025-12419","published":"2025-11-27","fixed":"11.0.4","kev":false,"link":{"from":"CVE-2025-12421","to":"CVE-2025-12419","relation":"successor","confidence":"high","kind":"sequence","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"Go:github.com/mattermost/mattermost-server","fromFixed":"11.0.3","toFixed":"11.0.4","daysApart":0},{"kind":"version-step","provenance":"source","package":"Go:github.com/mattermost/mattermost/server/v8","fromFixed":"8.0.0-20251022210333-acda1fb5dd46","toFixed":"8.0.0-20251028000919-d3ed703dc833","daysApart":0},{"kind":"same-code","provenance":"machine","files":["server/channels/app/oauth.go"],"commits":["https://github.com/mattermost/mattermost/commit/15364790cc277cfaa372693d2d5442b87f70fd42","https://github.com/mattermost/mattermost/commit/364c2203de00fe0d8424b6b46d6f0eeb02a2539a","https://github.com/mattermost/mattermost/commit/5072bbf689a46b3b97b2373f26149f5891396e6b","https://github.com/mattermost/mattermost/commit/acda1fb5dd46a2f46c76ae67012423c760525eaa"],"basis":"shared file"}]}},{"cve":"CVE-2025-13324","published":"2025-12-17","fixed":"11.0.4+incompatible","kev":false,"link":{"from":"CVE-2025-12421","to":"CVE-2025-13324","relation":"successor","confidence":"high","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:github.com/mattermost/mattermost-server","fromFixed":"11.0.3","toFixed":"11.0.4","daysApart":20},{"kind":"same-code","provenance":"machine","files":["server/channels/app/oauth.go"],"commits":["https://github.com/mattermost/mattermost/commit/5072bbf689a46b3b97b2373f26149f5891396e6b","https://github.com/mattermost/mattermost/commit/acda1fb5dd46a2f46c76ae67012423c760525eaa","https://github.com/mattermost/mattermost/commit/364c2203de00fe0d8424b6b46d6f0eeb02a2539a","https://github.com/mattermost/mattermost/commit/7ccb62db7958abd6a4b21a06c5a4f5367a8f8b1f"],"basis":"shared file"}]}},{"cve":"CVE-2025-13767","published":"2025-12-24","fixed":"11.1.1+incompatible","kev":false,"link":{"from":"CVE-2025-12421","to":"CVE-2025-13767","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:github.com/mattermost/mattermost-server","fromFixed":"10.11.5","toFixed":"10.11.8","daysApart":27}]}},{"cve":"CVE-2025-64641","published":"2025-12-24","fixed":"11.1.1+incompatible","kev":false,"link":{"from":"CVE-2025-12421","to":"CVE-2025-64641","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"Go:github.com/mattermost/mattermost-server","fromFixed":"10.11.5","toFixed":"10.11.8","daysApart":27}]}}],"package":"Go:github.com/mattermost/mattermost-server"}}