CVE-2026-47389

Mastodon: SSRF protection bypass on older Ruby versions

Published Jun 24, 2026 CVSS 3.1 · 8.6 High EPSS < 1% KEV · Not listed
Description
Mastodon is a free, open-source social network server based on ActivityPub. Prior to 4.5.10, 4.4.17, and 4.3.23, when using Ruby versions older than 3.4, PrivateAddressCheck.private_address? returns false for IPv4-mapped IPv6 addresses (::ffff:a.b.c.d) corresponding to some private IPv4 addresses, depending on Ruby version, this can include loopback, RFC1918 private networks, and link-local space. An attacker who controls DNS for any domain can publish an AAAA record with such a mapped address; any outbound HTTP fetch Mastodon performs against that hostname then opens a real TCP connection to the underlying IPv4 address, including 127.0.0.1 and cloud-metadata endpoints such as 169.254.169.254. This vulnerability is fixed in 4.5.10, 4.4.17, and 4.3.23.

Analysis

AI-generated

Technical impact

Mastodon's PrivateAddressCheck fails to treat certain IPv4-mapped IPv6 addresses as private when a Ruby interpreter older than 3.4 is used. An attacker who controls the DNS for a chosen domain can publish an AAAA record pointing to an IPv4-mapped address that resolves to a private IP. When Mastodon performs an outbound HTTP fetch to that domain, it resolves to the mapped IPv4 address and opens a real TCP connection to the underlying IP. This connectivity can reach loopback interfaces, RFC1918 networks, or the host’s cloud-metadata service. The flaw therefore permits server‑side request forgery that can expose sensitive configuration data or provide a foothold for lateral movement within the trusted network.

Affected Systems

The vulnerability affects Mastodon releases earlier than 4.5.10, 4.4.17, and 4.3.23 when the server runs on Ruby 3.3 or earlier. All newer Mastodon major releases and Ruby versions 3.4 and above contain the fix.

Risk and Exploitability

The CVSS base score is 8.6, indicating high severity. No EPSS score is available and the issue is not listed in CISA's KEV catalog, but the probability of exploitation remains significant for Internet-facing Mastodon installations that use the affected Ruby versions. Attackers need control over a domain’s AAAA record and the ability to trigger an outbound HTTP request from the Mastodon server; once those conditions are met, internal resources can be accessed.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Mastodon to version 4.5.10, 4.4.17, or 4.3.23 or newer so the private‑address check is corrected.
  • If upgrading Mastodon is not immediately possible, upgrade the Ruby runtime to 3.4.0 or later to provide the correct private‑address logic.
  • Implement a firewall rule or network policy that blocks outbound connections from the Mastodon server to loopback, RFC1918, and link‑local IP ranges to prevent the SSRF from reaching internal services.

Generated by OpenCVE AI on June 24, 2026 at 21:38 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Joinmastodon
Joinmastodon mastodon
Vendors & Products Joinmastodon
Joinmastodon mastodon
Type Values Removed Values Added
Description Mastodon is a free, open-source social network server based on ActivityPub. Prior to 4.5.10, 4.4.17, and 4.3.23, when using Ruby versions older than 3.4, PrivateAddressCheck.private_address? returns false for IPv4-mapped IPv6 addresses (::ffff:a.b.c.d) corresponding to some private IPv4 addresses, depending on Ruby version, this can include loopback, RFC1918 private networks, and link-local space. An attacker who controls DNS for any domain can publish an AAAA record with such a mapped address; any outbound HTTP fetch Mastodon performs against that hostname then opens a real TCP connection to the underlying IPv4 address, including 127.0.0.1 and cloud-metadata endpoints such as 169.254.169.254. This vulnerability is fixed in 4.5.10, 4.4.17, and 4.3.23.
Title Mastodon: SSRF protection bypass on older Ruby versions
Weaknesses CWE-184
CWE-200
CWE-918
References
Metrics cvssV3_1

{'score': 8.6, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N'}

Weaknesses
  • CWE-184

    Incomplete List of Disallowed Inputs

  • CWE-200

    Exposure of Sensitive Information to an Unauthorized Actor

  • CWE-918

    Server-Side Request Forgery (SSRF)

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jun 25, 2026, 3:40 PM
Reserved
May 19, 2026, 7:22 PM
Status
Deferred
Published
Jun 24, 2026, 8:16 PM
Modified
Jun 25, 2026, 5:16 PM