CVE-2026-47389: Mastodon DNS SSRF via IPv4-Mapped IPv6 – Patch Now
Mastodon instances running older Ruby versions are vulnerable to a DNS-based attack that bypasses network security controls. An attacker can craft DNS responses pointing to private network addresses disguised as IPv6 addresses, tricking Mastodon into making HTTP requests to restricted targets like localhost or cloud metadata services. This could expose sensitive configuration data or internal services normally isolated from the internet.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 8.6 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
- Weaknesses (CWE)
- CWE-184, CWE-200, CWE-918
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-06-24 / 2026-06-25
NVD description (verbatim)
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.
1 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exploits how Ruby versions before 3.4 handle IPv4-mapped IPv6 addresses in the PrivateAddressCheck.private_address? method. When Mastodon performs outbound HTTP fetches (e.g., during content validation, link preview generation, or WebFinger lookups), it checks whether the resolved IP is private to prevent SSRF attacks. However, addresses in the form ::ffff:a.b.c.d that map to RFC1918 ranges, loopback (127.0.0.1), or link-local space (169.254.169.254) are incorrectly classified as public. An attacker controlling authoritative DNS for any domain can publish an AAAA record with such a mapped address, causing Mastodon to open a TCP connection to the underlying IPv4 address—potentially reaching cloud metadata endpoints or other internal infrastructure.
Business impact
A compromised Mastodon instance could leak sensitive operational data. Cloud-hosted Mastodon deployments are at particular risk: accessing 169.254.169.254 may expose temporary AWS credentials, Azure managed identity tokens, or GCP metadata that an attacker could then use to pivot into the hosting infrastructure. Private networks containing internal services (databases, monitoring systems, CI/CD infrastructure) become reachable from the Mastodon process. The attack requires only DNS control over a domain that Mastodon processes—a low bar if users post links to attacker-controlled sites or if the attacker compromises a registrar.
Affected systems
Mastodon versions prior to 4.5.10, 4.4.17, and 4.3.23 are affected. The vulnerability manifests only when running on Ruby versions older than 3.4. Older Ruby versions commonly used in production include Ruby 3.3, 3.2, 3.1, and 3.0. Instances already on Ruby 3.4+ are not vulnerable regardless of Mastodon version. Administrators should verify both their Mastodon version and Ruby runtime.
Exploitability
Exploitability is high. The attack requires only DNS control—obtained through domain ownership, DNS hijacking, or registrar compromise—and no authentication or user interaction beyond normal Mastodon operation (processing links in posts or federation). The barrier to weaponization is low: an attacker publishes a malicious AAAA record and waits for Mastodon to fetch content pointing to that domain. No CVE has been added to CISA's Known Exploited Vulnerabilities catalog as of publication date.
Remediation
Upgrade Mastodon to 4.5.10, 4.4.17, or 4.3.23 or later. For instances unable to upgrade immediately, update Ruby to version 3.4 or newer, which correctly handles IPv4-mapped IPv6 addresses in PrivateAddressCheck. Verify your current Ruby version via ruby --version and Mastodon version in the web interface or config.
Patch guidance
Apply patches in this order: (1) Update Ruby to 3.4+ if feasible and your instance supports it—test in a staging environment first. (2) Upgrade Mastodon to the minimum patched version matching your current branch: 4.5.10 (for 4.5.x), 4.4.17 (for 4.4.x), or 4.3.23 (for 4.3.x). (3) Restart all Mastodon processes. Follow your instance's deployment method (Docker, systemd, etc.) and test federation with a remote instance post-patch to confirm no regressions. Verify patch application: mastodon-cli version should show the updated version number.
Detection guidance
Monitor outbound HTTP(S) requests from Mastodon processes to private IP ranges, particularly 169.254.169.254 and 127.0.0.1, using network flow logs or host-based IDS. Search firewall and proxy logs for HTTP requests originating from Mastodon servers to link-local or RFC1918 addresses. If cloud-hosted, audit IAM logs for unexpected credential access following the vulnerability publication date. Check Mastodon logs for unusual WebFinger or link-fetch errors correlating with DNS lookups to attacker domains.
Why prioritize this
HIGH severity (CVSS 8.6) due to the breadth of reachable targets (confidentiality impact on cloud metadata and private services) and the ease of exploitation (DNS control only). Cloud-hosted Mastodon instances should prioritize this immediately; on-premises instances with strong network segmentation and no cloud metadata endpoints may defer slightly but should still patch within days.
Risk score, explained
CVSS 3.1 score of 8.6 (HIGH) reflects: Attack Vector Network (exploitable remotely via DNS), Attack Complexity Low (no special conditions), Privileges Required None, User Interaction None, Scope Changed (can reach systems beyond Mastodon), Confidentiality Impact High (sensitive metadata exposed), Integrity None, Availability None. The score appropriately captures that an unauthenticated remote attacker can reliably leak confidential data from private networks, though availability and integrity are not compromised.
Frequently asked questions
Does this vulnerability affect my Mastodon instance if I'm running Ruby 3.4 or newer?
No. The underlying bug in PrivateAddressCheck is fixed in Ruby 3.4, so instances on that version or newer are protected regardless of Mastodon version. Check your Ruby version with ruby --version before deciding to prioritize patching.
Can an attacker exploit this without controlling a domain's DNS?
The standard exploit path requires DNS control or compromise. However, an attacker with network-level DNS spoofing capability (e.g., on a shared network or via BGP hijacking) could also inject malicious AAAA records. Additionally, if users manually click links to domains controlled by the attacker, the risk is realized through normal Mastodon operation.
What data is at risk if my instance is hosted on AWS, Azure, or GCP?
Cloud metadata endpoints (169.254.169.254 on AWS/Azure, metadata.google.internal on GCP) expose temporary credentials, service account tokens, instance identity documents, and network configuration. An attacker gaining these can assume IAM roles, access cloud storage, or pivot to other cloud resources without direct authentication.
Is patching Mastodon alone sufficient, or must I update Ruby?
Patching Mastodon to the fixed version (4.5.10, 4.4.17, or 4.3.23+) is sufficient if you're already on Ruby 3.4+. If you're on Ruby 3.3 or older, you can patch Mastodon without updating Ruby and the fix will apply. However, updating Ruby to 3.4+ is recommended for defense-in-depth and other security improvements.
This analysis is provided for informational purposes and reflects the CVE record, vendor advisories, and common attack patterns as of the publication date. Verify patch availability and compatibility with your specific Mastodon deployment and Ruby environment before applying updates. Organizations should conduct their own risk assessment and testing in non-production environments. SEC.co does not provide warranty or guarantee regarding the completeness or accuracy of remediation steps; follow your vendor's official patch documentation. This vulnerability has not been added to CISA's Known Exploited Vulnerabilities list as of the date provided. Source: NVD (public-domain), retrieved 2026-08-02. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-53944MEDIUMGhost IPv6 SSRF Bypass in Versions 6.0.9–6.21.0
- CVE-2025-69755HIGHNeterbit NW-431F Router RCE and Data Exposure Vulnerability
- CVE-2026-0411HIGHNETGEAR Orbi Admin Takeover via Information Disclosure
- CVE-2026-10068HIGHSSRF in Shibby Tomato 1.28 miniupnpd (Unmaintained)
- CVE-2026-10107HIGHMoviePilot v2 SSRF in Image Proxy Allows Internal Network Access
- CVE-2026-10280HIGHServer-Side Request Forgery in Horizon921 mcpilot 0.1.0
- CVE-2026-10287HIGHSSRF in SourceCodester SEO Meta Tag Extractor 1.0
- CVE-2026-10586HIGHGutenberg Essential Blocks SSRF Vulnerability – High Risk Server-Side Request Forgery