Summary
A server-side request forgery vulnerability in Meta Ads MCP allows a network caller to make the server request attacker-selected URLs through the image upload function. Because redirects, URL schemes, destinations, and resolved IP addresses are not sufficiently restricted, the server may reach internal services, cloud metadata endpoints, or other protected network locations.
Affected context
The issue occurs in streamable-HTTP deployments where the image upload tool accepts a caller-controlled image URL and downloads it before Meta credential validation completes. Deployments are most exposed when the server can reach loopback interfaces, private network ranges, cloud metadata services, or internal applications that are not intended to accept requests from the MCP process.
Exploit preconditions
- Attack surface: The
upload_ad_imagetool exposed through a streamable-HTTP MCP deployment - Required access: Network access to the MCP server and any non-empty authorization value accepted before Meta credential validation
- Trigger point: Server-side image retrieval from the supplied image URL
- Why exploitation is possible: The HTTP client follows redirects without adequately validating the URL scheme, destination host, or resolved IP address, allowing requests to internal or otherwise restricted targets
Why this happens
The underlying bug is insufficient validation of attacker-controlled URLs before server-side retrieval. The downloader permits broad destinations and follows redirects without reapplying effective scheme, hostname, and IP-range restrictions. This behavior maps to CWE-918, where an application is induced to send requests from a trusted server context to unintended internal or protected resources.
Potential impact
- Internal service responses could be exposed to the caller
- Cloud instance metadata or other sensitive configuration could be disclosed
- State-changing requests could be sent to reachable internal services
- Internal applications could be probed or abused through the MCP server
- Reachable services could experience disruption or resource consumption
- Network segmentation assumptions could be weakened
General mitigation guidance
Mitigation generally focuses on treating remote image URLs as untrusted and
enforcing destination controls before and during retrieval.
Common defensive patterns include:
- Allowing only explicitly approved URL schemes, hosts, and ports
- Resolving hostnames and rejecting loopback, link-local, private, reserved, and otherwise prohibited IP ranges
- Rechecking every redirect target rather than trusting the initial URL
- Disabling redirects by default or permitting redirects only within an approved destination set
- Applying strict connection, response-size, and download-time limits
- Performing authentication and authorization before any network fetch
- Using an isolated egress proxy or restricted network identity for media retrieval
- Granting the MCP process only the network and service privileges it requires
How teams detect issues like this
Organizations can identify SSRF risks through:
- Static analysis for HTTP clients consuming user-controlled URLs
- Code review checks for unrestricted redirects and missing scheme, host, port, or IP validation
- Tests covering loopback, private, link-local, metadata, alternate numeric, and redirect-based destinations
- Egress policies that alert on attempts to reach prohibited address ranges
- Network telemetry correlating MCP requests with unusual internal destinations
- Policy enforcement requiring centralized, approved URL-fetching utilities
Automated security review tools may help flag server-side request flows, but
findings should be validated against deployment-specific network boundaries.

