Severity:

HIGH RISK

(7.3)

SSRF in mcp-url-downloader URL Validation

CVE-2026-7158

Deferred

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Indirect access to internal or protected network resources via server-side HTTP requests

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A server-side request forgery (SSRF) flaw in the _validate_url_safe function of mcp-url-downloader allows crafted URLs to bypass validation and trigger arbitrary outbound HTTP requests from the server.

When an attacker can influence the url parameter, they may coerce the service into connecting to internal or otherwise restricted endpoints, exposing internal resources and metadata services.

Affected context

This issue appears in deployments of mcp-url-downloader where:

  • The service accepts user-controlled or external input as the url parameter
  • _validate_url_safe is relied upon to enforce network and domain safety
  • The server has network access to internal services, cloud metadata endpoints, or other protected systems

The vulnerability is specifically located in src/mcp_url_downloader/server.py within the _validate_url_safe function, which insufficiently restricts which destinations the server may contact.

Exploit preconditions

  • Attack surface: Network-accessible API or interface that accepts a URL parameter handled by mcp-url-downloader
  • Required access: Ability to send requests to the service (often unauthenticated or low-privilege, depending on deployment)
  • Trigger point: Submission of a crafted url value that passes _validate_url_safe checks but resolves to an internal or restricted target
  • Why exploitation is possible: The URL validation logic is incomplete or incorrect (e.g., does not robustly validate hostnames, IP ranges, schemes, or redirects), enabling attackers to pivot the server's outbound HTTP requests toward unintended destinations

Why this happens

The core issue is a flawed URL validation routine that over-trusts derived properties of attacker-supplied URLs.

Instead of enforcing strict allowlists, robust parsing, and blocking of internal or sensitive address ranges (such as loopback, link-local, or cloud metadata IPs), _validate_url_safe allows URLs that can be resolved or transformed into protected endpoints.

This aligns with CWE-918: Server-Side Request Forgery (SSRF), where a server performs network requests on behalf of an attacker, effectively extending the attacker's reach into internal or otherwise unreachable networks.

Potential impact

  • Access to internal HTTP services not directly exposed to the internet
  • Interaction with cloud provider metadata endpoints, potentially leaking credentials or tokens
  • Enumeration of internal network structure and available services through timing and error responses
  • Abuse of the service as a proxy to bypass IP-based access controls or firewalls
  • Potential follow-on compromise if sensitive administrative interfaces or APIs are reachable internally

General mitigation guidance

Effective mitigation focuses on treating all external URLs as untrusted and drastically limiting where the server is allowed to connect.

Common defensive patterns include:

  • Enforcing a strict allowlist of domains or endpoints the downloader is permitted to contact
  • Robustly parsing URLs and blocking private, loopback, link-local, multicast, and cloud metadata IP ranges, including after DNS resolution and redirects
  • Restricting supported schemes to safe, expected types (e.g., https) and rejecting others outright
  • Isolating the downloader in a network segment with limited outbound connectivity and no direct path to sensitive internal services
  • Applying least-privilege principles to any credentials or tokens used by the downloader when calling external services

How teams detect issues like this

Organizations can approach detection of this vulnerability class by:

  • Reviewing code for URL validation functions that:
  • Rely solely on string checks without DNS and IP range validation
  • Do not implement denylisting of internal or metadata address ranges
  • Accept arbitrary schemes or fail to handle redirects safely
  • Using static analysis rules that flag:
  • Server-side HTTP clients called with user-controlled URLs
  • Network calls that lack associated allowlist or IP range checks
  • Implementing application-level monitoring to:
  • Log outbound requests, including destination IP/host and response metadata
  • Detect anomalous connections to internal IP ranges or known metadata endpoints
  • Integrating automated security review tools into CI pipelines to highlight SSRF-prone patterns and unguarded URL-based fetch operations

Sources

SourceLink
github.comgithub.com/dmitryglhf/url-download-mcp/issues/2
vuldb.comvuldb.com/submit/802062
vuldb.comvuldb.com/vuln/359757
vuldb.comvuldb.com/vuln/359757/cti

Frequently asked

questions

Yes. As long as an attacker can reach the mcp-url-downloader service and control the url parameter, they can attempt to exploit the SSRF remotely.

Typically, the attacker only needs network access to any endpoint that uses mcp-url-downloader to fetch URLs. Authentication requirements depend on how the surrounding application is deployed, but SSRF issues often arise on low-friction or unauthenticated interfaces.

The most robust fix is to replace permissive validation with a strict allowlist of permitted domains or endpoints, combined with thorough URL parsing and IP range checks. Network-level egress controls that limit where the service can connect further reduce risk.

Treat any feature that fetches URLs on behalf of users as high risk. Design it with an explicit trust model, enforce domain/IP allowlists, restrict schemes, perform validation after DNS resolution and redirects, and back it with network segmentation and monitoring so that even if validation logic fails, internal resources remain protected.

Find out what's already
exploitable in your codebase.