Summary
Qwen-Agent contains a server-side request forgery vulnerability in its document parsing path, where caller-supplied paths may be interpreted as URLs without sufficient scheme or host validation. An attacker who can access the unauthenticated Gradio interface may cause the server to request internal resources, including cloud metadata services, and expose retrieved content through parsed document output.
Affected context
The vulnerability occurs in Qwen-Agent deployments that expose the Gradio interface and use the document parsing functionality with caller-controlled path values. Risk is higher when the server can reach internal network services, cloud metadata endpoints, or other sensitive locations, and when parsed response content is returned to the requester.
Exploit preconditions
- Attack surface: The document parsing functionality exposed through the Gradio interface
- Required access: Access to the unauthenticated interface or another path that accepts document locations
- Trigger point: Processing a caller-supplied path as part of document parsing
- Why exploitation is possible: The application does not sufficiently restrict URL schemes or validate destination hosts before making outbound requests
Why this happens
The underlying bug is server-side request forgery, mapped to CWE-918. The document parser treats an externally supplied path as a network location without enforcing an allowlist of schemes, destinations, or network zones. This permits application-side request behavior to be influenced by an untrusted caller, potentially allowing access to internal services and returning their responses through normal parsing output.
Potential impact
- The server may issue requests to internal network services
- Cloud instance metadata or other sensitive endpoint content could be disclosed
- Internal service information may be exposed through parsed document output
- Network segmentation controls could be weakened from the application's network position
- Sensitive credentials or configuration data may be accessed if reachable
General mitigation guidance
Mitigation typically focuses on reducing trust in caller-supplied document locations and enforcing outbound request boundaries.
Common defensive patterns include:
- Accepting local files or approved object-storage references instead of arbitrary URLs
- Allowlisting permitted URL schemes, hosts, ports, and destination networks
- Blocking loopback, link-local, private, and otherwise restricted address ranges
- Revalidating resolved addresses to reduce DNS rebinding and redirect-based bypasses
- Disabling or tightly controlling redirects and unsupported network protocols
- Limiting the application's outbound network access through egress policy
- Avoiding unnecessary exposure of fetched response content to callers
- Running the service with least-privilege network and runtime permissions
How teams detect issues like this
Organizations commonly detect SSRF risks through:
- Static analysis rules for HTTP clients receiving user-controlled URLs or paths
- Code review checks for missing scheme, host, port, redirect, and destination validation
- Tests covering loopback, private, link-local, metadata, alternate-encoding, and redirect targets
- Egress monitoring for unexpected requests from document-processing workers
- Network policy enforcement that restricts application access to internal services
- Logging and alerting on requests to sensitive address ranges or unusual URL schemes
Automated security review tools may help identify data flows from interface inputs to outbound request functions.

