Loading...
Skip to main content

CVE-2025-12421

CRITICAL

Mattermost fails to to verify the token used during code exchange

Published November 27, 2025Updated December 15, 2025Source: osv

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

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/mattermost/mattermost/server/v8 to 8.0.0-20251022210333-acda1fb5dd46 or later
go get github.com/mattermost/mattermost/server/v8@v8.0.0-20251022210333-acda1fb5dd46
Go
Update github.com/mattermost/mattermost-server to 10.12.2 or later
go get github.com/mattermost/mattermost-server@v10.12.2
Go
Update github.com/mattermost/mattermost-server to 10.11.5 or later
go get github.com/mattermost/mattermost-server@v10.11.5
Go
Update github.com/mattermost/mattermost-server to 10.5.13 or later
go get github.com/mattermost/mattermost-server@v10.5.13
Go
Update github.com/mattermost/mattermost-server to 11.0.3 or later
go get github.com/mattermost/mattermost-server@v11.0.3

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (5)

PackageEcosystemAffectedFixed In
github.com/mattermost/mattermost/server/v8
go
All versions8.0.0-20251022210333-acda1fb5dd46
github.com/mattermost/mattermost-server
go
All versions10.12.2
github.com/mattermost/mattermost-server
go
All versions10.11.5
github.com/mattermost/mattermost-server
go
All versions10.5.13
github.com/mattermost/mattermost-server
go
All versions11.0.3

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.9 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

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/v8 and github.com/mattermost/mattermost-server. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-12421 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.9

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-mp6x-97xj-9x62
GO-2025-4170

Related CVEs

  • CVE-2025-12419
    CRITICAL

    Mattermost fails to properly validate OAuth state tokens during OpenID Connect authentication

  • CVE-2025-4981
    CRITICAL

    Mattermost allows authenticated users to write files to arbitrary locations

  • CVE-2026-3108
    HIGH

    Mattermost allows attackers to manipulate administrator terminals via crafted messages containing ANSI and OSC escape sequences

  • CVE-2025-58073
    HIGH

    Mattermost has a Missing Authorization vulnerability

  • CVE-2026-6346
    HIGH

    Mattermost doesn't sanitize sensitive configuration fields before including them in support packet generation

  • CVE-2026-24458
    HIGH

    Mattermost fails to properly handle very long passwords

  • CVE-2025-58075
    HIGH

    Mattermost has a Missing Authorization vulnerability

  • CVE-2026-5740
    HIGH

    Mattermost doesn't properly validate msgpack-encoded WebSocket frames before memory allocation

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies