Summary
A server-side request forgery (SSRF) vulnerability in AutoGPT's SendDiscordFileBlock allows unvalidated URLs to be fetched directly via aiohttp.ClientSession().get.
If an attacker can control the URL parameter, they may coerce the AutoGPT backend into making arbitrary HTTP requests to internal or external services, potentially accessing sensitive resources or abusing internal network trust.
Affected context
This vulnerability arises in AutoGPT deployments where the SendDiscordFileBlock feature is exposed and accepts user-controlled or indirectly influenced URLs.
The affected code path uses aiohttp.ClientSession().get directly on the provided URL without applying allowlists, deny-lists, protocol restrictions, or network boundary checks.
Environments where the AutoGPT service can reach internal networks, metadata services, or other sensitive infrastructure over HTTP are particularly at risk.
Exploit preconditions
- Attack surface: HTTP API or workflow interface that triggers SendDiscordFileBlock with a caller-specified URL.
- Required access: Ability to supply or influence the URL parameter (e.g., through an API call, workflow configuration, or upstream integration).
- Trigger point: Invocation of aiohttp.ClientSession().get using the unvalidated URL in SendDiscordFileBlock.
- Why exploitation is possible: The implementation does not validate or constrain the destination of outbound HTTP requests, allowing attackers to redirect the server to arbitrary endpoints, including internal-only addresses.
Why this happens
The core issue is unvalidated outbound HTTP requests initiated from a privileged server environment, matching CWE-918: Server-Side Request Forgery (SSRF).
SendDiscordFileBlock passes a user-controlled URL directly into aiohttp.ClientSession().get without:
- Restricting allowed hostnames, IP ranges, or protocols
- Blocking access to internal IPs, loopback interfaces, or cloud metadata endpoints
- Enforcing scheme validation (e.g., limiting to https on trusted domains)
This pattern causes the server to act as a proxy, issuing attacker-directed requests from within the application's network boundary.
Potential impact
- Access to internal HTTP services that are not directly exposed to the internet (e.g., admin panels, internal APIs).
- Retrieval of sensitive instance or container metadata from cloud provider metadata endpoints.
- Enumeration of internal network topology and available services via timing and error responses.
- Use of the AutoGPT backend as a blind or reflected proxy to bypass IP-based access controls.
- Potential pivot to further vulnerabilities in internal services (e.g., using SSRF to reach endpoints with SQLi, RCE, or misconfigured admin interfaces).
General mitigation guidance
Effective mitigation focuses on constraining outbound requests and reducing trust in user-supplied URLs:
- Introduce strict allowlists for permitted domains or paths that SendDiscordFileBlock may contact.
- Reject or sanitize URLs that resolve to private, loopback, link-local, or multicast IP ranges.
- Enforce protocol restrictions (e.g., https only) and block non-HTTP schemes.
- Use network-layer egress controls (firewalls, security groups) to prevent the application from reaching sensitive internal services or metadata endpoints.
- Run the AutoGPT service with least-privilege network access, limiting what internal resources it can reach even if SSRF is triggered.
How teams detect issues like this
Organizations can detect and manage SSRF risks through multiple layers:
- Static analysis: Search code for HTTP client calls (e.g., aiohttp.ClientSession().get) that take parameters directly derived from request input or workflow configuration, without validation or allowlisting.
- Code review: Flag patterns where outbound requests are made to arbitrary URLs, especially in components that handle file loading, webhooks, or proxy-like behavior.
- Runtime monitoring: Log outbound HTTP requests from the application; alert on connections to unexpected IP ranges (e.g., 169.254.169.254, 127.0.0.0/8, 10.0.0.0/8, 192.168.0.0/16).
- Policy enforcement: Adopt secure coding guidelines requiring domain allowlists for any feature that fetches remote resources and integrate automated checks into CI pipelines.

