Summary
PraisonAIAgents' web_crawl() tool previously accepted arbitrary URLs from AI agents without any validation, enabling server-side request forgery (SSRF).
An attacker—or a malicious prompt injection within crawled content—could coerce the agent into fetching cloud metadata endpoints, internal services, or local files, potentially exposing sensitive data from internal networks and the host environment.
Affected context
This vulnerability appears in environments where PraisonAIAgents is deployed with the web_crawl() tool enabled and allowed to follow or act on arbitrary URLs supplied by agents or user prompts.
It is most relevant when:
- The agent runtime has outbound network access beyond the public internet (e.g., to VPC/internal services)
- The runtime executes in cloud environments exposing instance metadata services
- The process can reach localhost or internal-only endpoints
- The code accepts URLs from model output or user instructions without validation
Exploit preconditions
- Attack surface: The web_crawl() function in praisonaiagents/tools/web_crawl_tools.py, reachable indirectly through AI agent actions, tool calls, or user instructions.
- Required access: Ability to influence the URL parameter passed to web_crawl(), either directly (user prompt, tool call) or indirectly (prompt injection in previously crawled pages).
- Trigger point: An agent invocation that calls web_crawl() with an attacker-controlled URL (e.g., cloud metadata endpoint, internal HTTP service, or file:// URL).
- Why exploitation is possible: The function performs outbound requests with no scheme allowlisting, hostname/IP blocklisting, or private network checks, so untrusted URLs are treated as safe and requested from a privileged network position.
Why this happens
The underlying issue is a lack of URL trust boundaries and network egress controls in a server-side HTTP client used by an AI agent tool.
The web_crawl() implementation treats URLs provided by the AI agent as benign and performs requests without:
- Validating allowed URL schemes
- Restricting destinations to public, non-sensitive endpoints
- Detecting or blocking access to internal IP ranges, localhost, or cloud metadata services
This maps to CWE-918: Server-Side Request Forgery (SSRF), where a server-side component issues arbitrary network requests controlled by an attacker, leveraging its network position to access otherwise unreachable resources.
Potential impact
- Unauthorized access to cloud instance metadata endpoints, potentially exposing credentials, tokens, or configuration secrets
- Discovery and interaction with internal HTTP services, APIs, or admin panels not exposed to the public internet
- Access to services bound only to localhost (127.0.0.1), enabling interaction with debug or management interfaces
- Potential reading of local files via file:// URLs if the underlying libraries support it
- Use of the agent runtime as a pivot point for internal network reconnaissance
- Exposure of sensitive configuration data, environment variables, or internal service responses in model outputs or logs
General mitigation guidance
Effective mitigation typically focuses on controlling where server-side components are allowed to connect and which URLs agents may request.
Common defensive patterns include:
- Implementing strict scheme allowlisting (e.g., allowing only http:// and https://, disallowing file:// and other dangerous schemes).
- Enforcing network-level egress policies to limit access to internal IP ranges, metadata endpoints, and localhost from the agent runtime.
- Adding hostname/IP blocklists for known sensitive endpoints such as:
- Cloud provider metadata services
- RFC1918 private ranges (e.g., 10.0.0.0/8, 192.168.0.0/16)
- 127.0.0.0/8 and ::1
- Normalizing and parsing URLs with robust libraries before any request is sent, and rejecting malformed or ambiguous URLs.
- Designing agent tools to operate on pre-curated URL sets or pre-approved domains rather than arbitrary agent-supplied URLs.
- Running the agent and its tools with least-privilege network access, minimizing visibility into internal services and metadata.
How teams detect issues like this
Organizations can look for this class of issue both in code and at runtime:
- Static analysis and code review:
- Flag HTTP client usage (e.g., requests.get, aiohttp, etc.) where the URL originates from model output, user input, or other untrusted sources.
- Review agent tool implementations for missing allowlists, host validation, and IP range checks.
- Search for file://, gopher://, or similar schemes being accepted or passed to network/file APIs.
- Policy enforcement:
- Apply secure coding guidelines requiring URL validation helpers before any outbound call.
- Use CI/CD checks (linters or SAST tools) to detect direct use of HTTP clients without validation wrappers.
- Runtime and network monitoring:
- Monitor egress traffic from agent runtimes for connections to known metadata endpoints or private IP ranges.
- Set alerts for unusual outbound requests (e.g., 169.254.169.254, 127.0.0.1, 10.x, 192.168.x).
Automated review tools that understand data flow from untrusted input to HTTP clients can be particularly useful in identifying SSRF patterns like this.

