☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2024-25618

CVE-2024-25618 Supply Chain Attack in Mastodon
📅 PUBLISHED: 2024-02-14 20:45 UTC 🔄 UPDATED: 2026-09-23 20:36 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.47%
👁️
0.47% probability
11.8× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
4.2
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-25618 is an account takeover vulnerability in Mastodon, a free, open-source social network server. The flaw allows an attacker to hijack a user's account by exploiting the identity linking mechanism when external authentication providers (CAS, SAML, OIDC) are used. If an authentication provider allows email address changes or multiple providers are configured, an attacker can register with the same email as an existing user and gain control of that account. The vulnerability is rated medium severity (CVSS 4.2) and affects all Mastodon versions prior to 4.2.6, 4.1.14, 4.0.14, and 3.5.18. No public exploit code is available, but the attack vector is straightforward for misconfigured providers.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

Mastodon is a Ruby on Rails application distributed via GitHub and Docker. The vulnerability is in the authentication logic, not in a specific package dependency. However, the reliance on external authentication providers introduces supply chain risk: if a provider (e.g., Microsoft Azure AD) allows unverified email changes, the Mastodon instance is vulnerable. Administrators should audit their OIDC/SAML provider configurations and ensure email verification is enforced.

CVSS Breakdown & Threat Level

  • CVSS Score: 4.2 (Medium)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
  • Attack Vector: Network (AV:N) – exploitable remotely.
  • Attack Complexity: Low (AC:L) – no special conditions required.
  • Privileges Required: None (PR:N) – attacker does not need prior access.
  • User Interaction: Required (UI:R) – victim must log in via the external provider.
  • Scope: Unchanged (S:U) – vulnerability affects only the vulnerable component.
  • Confidentiality Impact: Low (C:L) – attacker gains access to user data.
  • Integrity Impact: Low (I:L) – attacker can post or modify account settings.
  • Availability Impact: None (A:N) – no denial of service.

Threat Level: Medium. The vulnerability requires the external authentication provider to allow email changes, but many popular providers (e.g., Microsoft Azure AD) make this easy to misconfigure. The attack is stealthy and can lead to full account takeover.

Deep Dive & Mechanics

Mastodon allows users to log in via external authentication providers (CAS, SAML, OIDC). When a user authenticates for the first time, Mastodon checks the email address provided by the external provider against existing local accounts. If a match is found, the new identity is linked to that existing account. The vulnerability arises because Mastodon does not verify that the email address is still controlled by the original user. If the external provider allows changing the email address (e.g., due to a misconfiguration or a feature like "change email without verification"), an attacker can:

  1. Register an account with the external provider using the victim's email address.
  2. Log in to Mastodon via that provider.
  3. Mastodon links the new identity to the victim's existing account, giving the attacker full control.

This is particularly dangerous with OpenID Connect (OIDC) providers that support dynamic client registration, as an attacker could register a malicious client and exploit the flow.

Root Cause: The User model in Mastodon uses email as the sole identifier for linking external identities. The fix involves adding a verification step or using a unique, immutable identifier from the provider (e.g., sub claim in OIDC).

Vulnerable vs. Patched Code

Vulnerable Code (pre-4.2.6): In app/models/user.rb, the method find_by_email is used to locate existing users:

def self.find_by_email(email)
  User.find_by(email: email)
end

When an external authentication callback is processed, the email from the provider is passed directly to this method without additional checks.

Patched Code (4.2.6+): The fix introduces a verification step that checks the provider's unique identifier (e.g., sub for OIDC) before linking:

def self.find_by_identity(provider, uid)
  Identity.find_by(provider: provider, uid: uid)&.user
end

Additionally, the email matching is now only used if no existing identity is found, and a confirmation step is required to prevent automatic linking.

Exploitation & Lab Setup

Red Team

Prerequisites:

  • Access to an external authentication provider that allows email changes (e.g., Microsoft Azure AD with "Email change without verification" enabled).
  • A target Mastodon instance (version < 4.2.6) configured with that provider.

Exploitation Steps:

  1. Identify a victim's email address (e.g., victim@example.com).
  2. Register a new account with the external provider using that email.
  3. Log in to the Mastodon instance via the external provider.
  4. Mastodon links the new identity to the victim's existing account.
  5. The attacker now has full control: can read DMs, post, change settings, etc.

Lab Setup:

  • Deploy a vulnerable Mastodon instance (e.g., using Docker with version 4.2.5).
  • Configure an OIDC provider (e.g., Keycloak or Azure AD) with email change enabled.
  • Create a victim account on Mastodon.
  • Execute the attack as described.

Blue Team

Detection:

  • Monitor authentication logs for multiple accounts with the same email from different providers.
  • Alert on new external identity links to existing accounts without prior verification.
  • Use the detection rules below.

Prevention:

  • Upgrade to patched versions immediately.
  • Disable email change in external providers if not needed.
  • Enforce email verification before allowing identity linking.

Indicators of Compromise (IOCs)

  • Log Entries: Repeated Identity creation events for the same email but different uid values.
  • Network Traffic: Unusual OIDC/SAML authentication requests from new IPs for existing users.
  • User Behavior: Sudden changes in account settings or posts from a previously inactive user.

Example Log Pattern:

[2024-01-01 12:00:00] INFO  Identity created: provider=azure, uid=abc123, user_id=42
[2024-01-01 12:05:00] INFO  Identity created: provider=azure, uid=def456, user_id=42

Detection Engineering

YARA Rule

rule CVE_2024_25618_Mastodon_AccountTakeover {
    meta:
        description = "Detects Mastodon account takeover via external auth provider email mismatch"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "CVE-2024-25618"
    strings:
        $s1 = "find_by_email" nocase
        $s2 = "identity" nocase
        $s3 = "external" nocase
    condition:
        all of them
}

Sigma Rule

title: Mastodon Account Takeover via External Auth Provider
id: cve-2024-25618
status: experimental
description: Detects multiple identity links for the same user from different providers
logsource:
    product: mastodon
    service: auth
detection:
    selection:
        event: Identity created
    condition: selection | count(user_id) by email > 1
falsepositives:
    - Legitimate multiple provider usage (rare)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2024-25618 Mastodon Account Takeover"; flow:to_server; content:"POST"; http_method; content:"/auth/"; http_uri; content:"identity"; http_client_body; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade Mastodon to version 4.2.6, 4.1.14, 4.0.14, or 3.5.18.
  2. Review external authentication provider configurations and disable email change if not required.
  3. Enable email verification for all users.

Long-term:

  • Implement multi-factor authentication (MFA) for all accounts.
  • Monitor authentication logs for anomalies.
  • Use immutable identifiers (e.g., OIDC sub) for identity linking.

Workarounds: None available. Upgrade is mandatory.


Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-25618/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.