# CVE-2025-12421: Account Takeover via Code Exchange Endpoint

> CVE-2025-12421: Account Takeover via Code Exchange Endpoint. CVSS 9.9 (CVSS 3.1).

Canonical: https://rewindex.com/cve/CVE-2025-12421
Last updated: 2026-10-19T13:10:00Z

- Published: 2025-11-27 17:47 UTC · Updated: 2026-10-19 13:10 UTC · Assigner: Mattermost
- CVSS: 9.9 (CVSS 3.1) · Severity: Critical · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- EPSS: 0.42%, 36th percentile (scored 2026-10-25)
- CISA KEV: no
- CWE: CWE-303

## Description

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).

## Affected vendors and products

- Mattermost: Mattermost

## Tracked companies

- [Mattermost](https://rewindex.com/company/mattermost.md)

## References

- [CVE record on cve.org](https://www.cve.org/CVERecord?id=CVE-2025-12421)
- [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2025-12421)
- [https://mattermost.com/security-updates](https://mattermost.com/security-updates)

---

_Sources: CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (https://www.cve.org/) This product uses data from the NVD API but is not endorsed or certified by the NVD. (https://nvd.nist.gov/) Known Exploited Vulnerabilities catalog from CISA. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog) EPSS scores from FIRST (Exploit Prediction Scoring System). (https://www.first.org/epss/)_


---
Canonical: https://rewindex.com/cve/CVE-2025-12421 · Markdown: https://rewindex.com/cve/CVE-2025-12421.md · JSON: https://rewindex.com/api/v1/cves/CVE-2025-12421 · Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) · Generated 2026-10-26T03:12:36.057Z
