Severity:

HIGH RISK

(7.3)

SSRF in Agentscope Cloud Metadata Endpoint

CVE-2026-6604

Deferred

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Network Pivoting and Access to Internal Resources via SSRF

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) vulnerability in Agentscope up to version 1.0.18 allows attackers to abuse the Cloud Metadata Endpoint via the _parse_url, prepare_image, and openai_audio_to_text functions to make arbitrary outgoing HTTP requests.

By manipulating the image_url or audio_file_url parameters, a remote attacker may coerce the service into contacting internal or otherwise restricted network resources on their behalf.

Affected context

The vulnerability occurs in Agentscope deployments that expose functionality for processing remote image or audio resources through the Cloud Metadata Endpoint.

When user-supplied URLs (image_url / audio_file_url) are accepted and fetched by the backend without strict validation or isolation, the server becomes a proxy capable of reaching internal services.

This is especially risky in environments where the application can access cloud instance metadata services, internal APIs, or other sensitive resources on private networks.

Exploit preconditions

  • Attack surface: Network-accessible endpoints that accept image_url or audio_file_url parameters and trigger _parse_url, prepare_image, or openai_audio_to_text.
  • Required access: Ability to send crafted requests to the application (typically unauthenticated or low-privilege, depending on deployment configuration).
  • Trigger point: The application attempts to fetch or process the remote resource at the supplied URL.
  • Why exploitation is possible: URL inputs are treated as trusted destinations, with insufficient filtering, allow-listing, or network-level isolation, enabling requests to arbitrary (including internal) hosts and protocols.

Why this happens

The core issue aligns with CWE-918: Server-Side Request Forgery, where a server-side component issues HTTP or related network requests based on user-controlled URLs.

In this case, helper functions such as _parse_url, prepare_image, and openai_audio_to_text appear to accept URLs and forward them to network-fetching logic without robust destination validation or contextual restrictions.

This insecure pattern allows external users to influence where the server connects, effectively turning the application into an unwilling proxy to reach internal networks, metadata endpoints, or other protected infrastructure.

Potential impact

  • Access to internal HTTP services that are not directly exposed to the internet
  • Interaction with cloud provider metadata services, potentially leaking credentials or instance configuration
  • Discovery and mapping of internal network topology via response behavior
  • Bypassing IP-based access controls or firewalls by leveraging the server's network position
  • Potential chaining with other vulnerabilities (e.g., internal admin endpoints) for privilege escalation

General mitigation guidance

Effective mitigation generally focuses on strict control over outbound requests initiated from user-supplied URLs and on limiting trust in remote resources:

  • Prefer an allow-list of safe domains and URL schemes rather than attempting to block known-bad patterns.
  • Enforce URL parsing and validation that rejects private IP ranges, loopback addresses, link-local ranges, and non-HTTP(S) protocols where not explicitly required.
  • Use network-level egress controls (such as firewall rules or VPC service controls) to prevent application containers from reaching metadata services and sensitive internal subnets.
  • Isolate URL-fetching functionality into a minimal-privilege service or sandbox with tightly constrained outbound connectivity.
  • Normalize and re-validate URLs after redirects, or disable following redirects where possible to avoid redirect-based SSRF bypasses.
  • Treat remote media ingestion (images, audio, etc.) as untrusted input and avoid embedding it directly in privileged workflows without additional checks.

How teams detect issues like this

High-level detection for SSRF issues typically combines code-level analysis with behavioral monitoring:

  • Static analysis and code review:
  • Flag usage of HTTP client libraries (e.g., requests, httpx, urllib, or cloud SDKs) where the target URL is derived from user-controllable parameters such as image_url and audio_file_url.
  • Look for missing checks against private IP ranges, loopback, and non-HTTP(S) schemes in URL parsing utilities like _parse_url.
  • Review any "URL proxy", "image fetch", or "media download" utilities to ensure they enforce allow-lists and egress restrictions.
  • Runtime monitoring:
  • Monitor outbound traffic from application instances for unusual destinations (e.g., 169.254.169.254, RFC1918 ranges, or unexpected internal hostnames).
  • Use network policies or egress proxies that log and, where necessary, block connections to sensitive endpoints.
  • Security testing:
  • Incorporate SSRF test cases into routine penetration testing and automated DAST, focusing on parameters that accept URLs or file references.

Automated application security tools and custom static analysis rules can assist in flagging SSRF-prone patterns early in development and during CI.

Sources

SourceLink
gist.github.comgist.github.com/YLChen-007/e3e0741b297d8c2ffca59b6350d4c657
vuldb.comvuldb.com/submit/792224
vuldb.comvuldb.com/vuln/358239
vuldb.comvuldb.com/vuln/358239/cti

Frequently asked

questions

Yes. If the affected endpoints are exposed over the network, a remote attacker can exploit the SSRF by sending crafted requests with malicious image_url or audio_file_url values.

Not necessarily. Exploitation only requires the ability to reach and interact with the vulnerable API surface. Depending on deployment, the vulnerable endpoints may be accessible to unauthenticated or low-privileged users.

The most robust fix pattern is to strictly limit where the server can connect on behalf of users: enforce domain allow-lists and scheme restrictions, block access to internal and metadata IP ranges, and complement this with network-level egress controls that prevent the application from reaching sensitive addresses.

Design any feature that fetches remote resources using a "zero trust" mindset: treat all user-supplied URLs as untrusted, enforce allow-lists and robust URL validation, isolate outbound network access using firewalls or network policies, and incorporate SSRF-focused checks into code review, threat modeling, and automated security testing.

Find out what's already
exploitable in your codebase.