CVE-2025-12421 — Vulnerability in mattermost/mattermost-server
Mattermost fails to to verify the token used during code exchange
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.66%). Schedule for your next planned update.
Does your project use an affected github.com/mattermost/mattermost-server version?
Paste your go.sum to check it for CVE-2025-12421 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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).
Advisory Timeline
- First published November 27, 2025 (364 days ago).
- Last revised December 15, 2025 — 18 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
go get github.com/mattermost/mattermost-server@v10.12.2
go get github.com/mattermost/mattermost-server@v10.11.5
go get github.com/mattermost/mattermost-server@v10.5.13
go get github.com/mattermost/mattermost-server@v11.0.3
go get github.com/mattermost/mattermost/server/v8@v8.0.0-20251022210333-acda1fb5dd46
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (5)
Affects 1 ecosystem: Go (2).
| Package | Fixed In |
|---|---|
| github.com/mattermost/mattermost-server Go · Affected: All versions | 10.12.2 |
| github.com/mattermost/mattermost-server Go · Affected: All versions | 10.11.5 |
| github.com/mattermost/mattermost-server Go · Affected: All versions | 10.5.13 |
| github.com/mattermost/mattermost-server Go · Affected: All versions | 11.0.3 |
| github.com/mattermost/mattermost/server/v8 Go · Affected: All versions | 8.0.0-20251022210333-acda1fb5dd46 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-287Improper AuthenticationMITRE
- CWE-303
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.9 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2025-12421ADVISORY
- https://github.com/mattermost/mattermost/commit/5072bbf689a46b3b97b2373f26149f5891396e6bWEB
- https://github.com/mattermost/mattermost/commit/acda1fb5dd46a2f46c76ae67012423c760525eaaWEB
- https://github.com/mattermost/mattermost/commit/f361e7d75a7ab9df5a2106e1ceb919b94b55e41dWEB
- https://github.com/mattermost/mattermost/commit/feb598ed2b7ac3cb78a253b032ad7e4628b0de00WEB
- https://github.com/mattermost/mattermostPACKAGE
- https://mattermost.com/security-updatesWEB
Frequently Asked Questions
- What is CVE-2025-12421?
- Mattermost fails to to verify the token used during code exchange. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.9/10).
- How do I check if my project is affected by CVE-2025-12421?
- CVE-2025-12421 affects github.com/mattermost/mattermost-server and github.com/mattermost/mattermost/server/v8. It has a 0.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-12421 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This is a below-median EPSS score — only 46.8% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2025-12419CRITICAL
Mattermost fails to properly validate OAuth state tokens during OpenID Connect authentication
- CVE-2025-4981CRITICAL
Mattermost allows authenticated users to write files to arbitrary locations
- CVE-2026-7387HIGH
Mattermost doesn't require role-management authorization when setting the scheme_admin flag on group syncable link and patch endpoints
- CVE-2025-58073HIGH
Mattermost has a Missing Authorization vulnerability
- CVE-2026-24458HIGH
Mattermost fails to properly handle very long passwords
- CVE-2025-9079HIGH
Mattermost Path Traversal vulnerability
- CVE-2025-58075HIGH
Mattermost has a Missing Authorization vulnerability
- CVE-2026-5740HIGH
Mattermost doesn't properly validate msgpack-encoded WebSocket frames before memory allocation