PraisonAI: Server-Side Request Forgery (SSRF) in SearxNG / search_web Tools via Attacker-Controlled searxng_url Parameter
A Server-Side Request Forgery (SSRF) vulnerability in PraisonAI's `praisonaiagents` package (versions prior to 1.6.61), specifically within the `searxng_search` and `search_web` tools, allows an attacker to exploit prompt injection by controlling the `searxng_url` parameter, enabling the server to make requests to arbitrary internal endpoints, read responses, perform network enumeration, and potentially expose cloud instance credentials.
A significant Server-Side Request Forgery (SSRF) vulnerability has been identified in PraisonAI's praisonaiagents package, affecting versions prior to 1.6.61. This flaw stems from a lack of validation on the searxng_url parameter within the searxng_search and search_web tools, which are part of the default agent toolset. Attackers can leverage prompt injection techniques to manipulate the searxng_url parameter, forcing the agent's underlying requests.get() function to make unvalidated HTTP requests to internal systems. This allows for reading responses from internal services and APIs, performing internal network enumeration, and potentially accessing cloud instance metadata endpoints (e.g., 169.254.169.254) to expose sensitive IAM credentials or other system information. The vulnerability does not require misconfiguration and is directly exploitable through attacker-controlled content ingested by the agent.
Attack Chain
- Attacker Crafts Malicious Content: An attacker embeds a carefully constructed prompt into content (e.g., a web page, file, or chat message) that an
praisonaiagentsLLM agent is likely to ingest. - Agent Ingests Malicious Prompt: The
praisonaiagentsLLM agent processes the attacker-controlled content, which includes instructions designed to coerce it into calling itssearch_weborsearxng_searchtool. - Agent Calls Tool with Malicious Parameter: Triggered by the prompt, the agent invokes
search_web(...)orsearxng_search(...), passing an attacker-specified internal URL (e.g.,http://127.0.0.1:19998/admin/secretsorhttp://169.254.169.254/latest/meta-data/) as thesearxng_urlparameter. - Unvalidated HTTP Request Made: The Python code within
src/praisonai-agents/praisonaiagents/tools/searxng_tools.pyorsrc/praisonai-agents/praisonaiagents/tools/web_search.pyreceives thesearxng_urland uses it directly inrequests.get()without any scheme, host, or port validation. - Server Performs Internal Request: The server hosting the
praisonaiagentsinstance attempts to connect to the specified internal endpoint, effectively turning the agent into a proxy for the attacker. - Internal Response Captured and Returned: If the internal endpoint responds, its HTTP response body is captured by the agent tool, parsed (specifically for a JSON
resultskey), and returned into the agent's context. - Data Exfiltration/Enumeration: The attacker can then coerce the agent (via further prompt injection or subsequent tool calls) to exfiltrate the captured internal data or to continue enumerating internal services based on error responses from closed ports.
- Credential Exposure: In cloud environments, successful access to the instance metadata endpoint (
169.254.169.254) can lead to the exposure of IAM role credentials, allowing for further compromise of cloud resources.
Impact
This SSRF vulnerability significantly compromises the security of praisonaiagents deployments. Any agent configured with the default search_web tool and capable of ingesting untrusted content (such as browsing the web, reading files, or processing external messages) is at risk. Attackers can gain unauthorized access to internal services and APIs, potentially reading sensitive data from administration panels or internal microservices that return JSON. The ability to distinguish between open and closed internal ports allows for comprehensive internal network enumeration, mapping out the internal infrastructure. Crucially, the reachability of cloud instance metadata endpoints (e.g., AWS IMDS) presents a high risk of IAM credential theft, which could lead to full compromise of the cloud environment. There are no known instances of active exploitation in the wild, but the existence of a public PoC increases the likelihood of future attacks.
Recommendation
- Patch
praisonaiagentsimmediately: Upgrade thepraisonaiagentspackage to version 1.6.61 or later to remediate CVE-2026-XXXX. - Deploy Sigma rules: Implement the provided Sigma rules (
Detect Outbound PraisonAI Connections to Internal/Metadata IPsandDetect PraisonAI Process Execution) into your SIEM to identify suspicious activity. - Implement egress filtering: Configure network egress filtering at the host or network perimeter to block
praisonaiagentsprocesses from initiating connections to RFC1918 private IP ranges and the cloud instance metadata IP169.254.169.254. - Monitor outbound network connections: Enable detailed logging for all outbound network connections from systems running
praisonaiagentsto detect anomalous destinations, especially the IP address169.254.169.254.
Detection coverage 2
Detect Outbound PraisonAI Connections to Internal/Metadata IPs
highDetects outbound network connections initiated by the PraisonAI agent process to common internal IP ranges or cloud metadata service IP, indicative of SSRF exploitation via the searxng_url parameter.
Detect PraisonAI Agent Process Execution with Suspicious Command Line Arguments
infoDetects the execution of PraisonAI agent processes with command line arguments that could indicate an attempt to bypass security or load untrusted configurations, though the primary vector is prompt injection.
Detection queries are available on the platform. Get full rules →
Indicators of compromise
1
ip
| Type | Value |
|---|---|
| ip | 169.254.169.254 |