CVE-2024-25618 External OpenID Connect Account Takeover by E-Mail Change in mastodon

Medium 4.2 Published Updated

Attackers can hijack Mastodon accounts by exploiting email-based identity linking when external authentication providers allow unverified email changes.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-25618?

CVE-2024-25618 is a medium-severity authentication bypass vulnerability in mastodon, published on 14 Feb 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Mastodon is a free, open-source social network server based on ActivityPub. Mastodon allows new identities from configured authentication providers (CAS, SAML, OIDC) to attach to existing local users with the same e-mail address. This results in a possible account takeover if the authentication provider allows changing the e-mail address or multiple authentication providers are configured. When a user logs in through an external authentication provider for the first time, Mastodon checks the e-mail address passed by the provider to find an existing account. However, using the e-mail address alone means that if the authentication provider allows changing the e-mail address of an account, the Mastodon account can immediately be hijacked. All users logging in through external authentication providers are affected. The severity is medium, as it also requires the external authentication provider to misbehave. However, some well-known OIDC providers (like Microsoft Azure) make it very easy to accidentally allow unverified e-mail changes. Moreover, OpenID Connect also allows dynamic client registration. This issue has been addressed in versions 4.2.6, 4.1.14, 4.0.14, and 3.5.18. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-306, CWE-287

Which versions are affected by CVE-2024-25618?

1 open source package ship an affected version, including mastodon. It affects 1 product.

PackageAffectedFixed in
mastodon BitnamiAll versions3.5.18, 4.0.14, 4.1.14, 4.2.6

Products include Joinmastodon Mastodon.

How do I fix CVE-2024-25618?

Upgrade mastodon to a fixed version for your release line: 3.5.18, 4.0.14, 4.1.14 or 4.2.6.

Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.

Is CVE-2024-25618 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-25618 exists.

Sources

Also known as BIT-mastodon-2024-25618, GHSA-vm39-j3vx-pch3.

Is CVE-2024-25618 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free