Summary
Fedify's URL validation logic for outbound fetches incompletely distinguishes public from non-public IPv4 addresses, leaving several special-use ranges treated as if they were safe public destinations.
When a Fedify-based ActivityPub server relies on this check to prevent SSRF, an attacker can craft URLs to these misclassified ranges and potentially reach internal or sensitive network resources through the server.
Affected context
This vulnerability affects Fedify-based federated server applications that:
- Use Fedify's runtime document or media fetching features, and
- Rely on
validatePublicUrl()/isValidPublicIPv4Address()as their primary SSRF safeguard.
The issue is specific to IPv4 address handling, where some non-public special-use, reserved, multicast, benchmarking, or carrier-grade NAT ranges are incorrectly treated as valid public destinations.
Actual risk depends on what services are reachable at those ranges from the Fedify host environment and whether they expose sensitive functionality or metadata.
Exploit preconditions
- Attack surface: HTTP or protocol endpoints where a remote client can supply or influence a URL that Fedify later fetches (e.g., ActivityPub objects, media URLs, or linked resources).
- Required access: Ability to interact with the Fedify-based application as a remote client (typically unauthenticated or low-privilege ActivityPub peers or users).
- Trigger point: The server calling outbound fetch routines that rely on
validatePublicUrl()to approve a URL containing an IPv4 address in a misclassified range. - Why exploitation is possible: The IPv4 validation logic only blocks common private/local ranges and loopback, but fails to recognize several other non-public or sensitive IPv4 ranges, allowing attacker-controlled URLs to be treated as "public" and fetched by the server.
Why this happens
The root cause is an incomplete network address validation implementation used as a defense against SSRF.
The validatePublicUrl() helper delegates to isValidPublicIPv4Address(), which explicitly rejects some RFC1918 and local ranges but does not account for other special-use, reserved, multicast, carrier-grade NAT, and related IPv4 blocks that are not true public addresses.
This maps primarily to CWE-918 (Server-Side Request Forgery), with aspects of CWE-1286 (Improper Validation of Syntactic Correctness of Input) and CWE-1389 (Improper Validation of Specified IP Address), since the code assumes that any IPv4 address outside a small blocked list is safe to contact, rather than enforcing a comprehensive allowlist or robust classification logic.
Potential impact
- Fedify servers may fetch resources from otherwise restricted or sensitive network ranges reachable from the host.
- Attackers could use the server as a proxy to scan internal or adjacent networks, inferring service presence and behavior.
- Access to metadata or status endpoints (e.g., cloud instance metadata) could lead to credential exposure or environment leakage.
- Interaction with misconfigured internal services might allow data exfiltration, state changes, or lateral movement in the hosting environment.
General mitigation guidance
Mitigation generally focuses on strengthening SSRF defenses and minimizing trust in user-supplied URLs:
- Replace bespoke IP range checks with well-maintained libraries or utilities that accurately classify public versus non-public IP ranges across IPv4 and IPv6, including all special-use and reserved blocks.
- Favor an allowlist model for outbound destinations: explicitly permit only known hostnames, domains, or IP ranges required by the application, and block all others by default.
- Enforce DNS and IP validation together: resolve hostnames and verify that all resolved addresses fall within approved public ranges before making outbound requests.
- Run outbound HTTP clients behind a network-level egress filter, proxy, or firewall that blocks access to internal, link-local, and metadata services regardless of application logic.
- Apply least-privilege principles for the Fedify process, limiting what internal networks and services are reachable from that runtime environment.
How teams detect issues like this
Detection efforts can combine code-level and environment-level checks:
- Static analysis and code review: Search for custom IP classification utilities and URL validation helpers used as SSRF defenses; verify that they comprehensively handle private, link-local, multicast, reserved, and carrier-grade NAT ranges.
- Configuration review: Inspect Fedify-based applications for reliance on
validatePublicUrl()without additional network controls, and verify whether allowlists, proxies, or egress firewalls are in place. - Runtime monitoring: Log outbound HTTP(S) requests from Fedify services and alert on traffic to non-routable, special-use, or unexpected address ranges.
- Security testing: Use controlled SSRF testing techniques to probe whether user-supplied URLs can trigger requests to internal endpoints (e.g., metadata services or internal APIs), while respecting legal and organizational boundaries.

