Описание
PraisonAIAgents: SSRF via unvalidated URL in web_crawl httpx fallback
| Field | Value |
|---|---|
| Severity | High |
| Type | SSRF -- unvalidated URL in web_crawl httpx fallback allows internal network access |
| Affected | src/praisonai-agents/praisonaiagents/tools/web_crawl_tools.py:133-180 |
Summary
web_crawl's httpx fallback path passes user-supplied URLs directly to httpx.AsyncClient.get() with follow_redirects=True and no host validation. An LLM agent tricked into crawling an internal URL can reach cloud metadata endpoints (169.254.169.254), internal services, and localhost. The response content is returned to the agent and may appear in output visible to the attacker.
This fallback is the default crawl path on a fresh PraisonAI installation (no Tavily key, no Crawl4AI installed).
Details
The vulnerable code is in tools/web_crawl_tools.py:148-155:
No scheme restriction, no hostname resolution, no private/link-local IP check. follow_redirects=True also means an attacker can use an open redirect on a public URL to bounce the request into internal networks.
download_file in file_tools.py:295-318, by contrast, validates URLs before requesting:
web_crawl has none of this.
PoC
Direct agent interaction:
Indirect prompt injection -- hidden instruction on a crawled page:
Impact
| Tool | Internal network blocked? |
|---|---|
download_file("http://169.254.169.254/...") | Yes |
web_crawl("http://169.254.169.254/...") | No |
On cloud infrastructure with IMDSv1, this gets you IAM credentials from the metadata service. On any deployment, it exposes whatever internal services the host can reach. No authentication is needed -- the attacker just needs the agent to process input that triggers a web_crawl call to an internal address.
Conditions for exploitability
The httpx fallback is active when:
TAVILY_API_KEYis not set, andcrawl4aipackage is not installed
This is the default state after pip install praisonai. Production deployments with Tavily or Crawl4AI configured are not affected through this path.
Remediation
Add URL validation before the httpx request. The private-IP check from file_tools.py can be extracted into a shared utility:
Affected paths
src/praisonai-agents/praisonaiagents/tools/web_crawl_tools.py:133-180--_crawl_with_httpx()requests URLs without validation
Пакеты
praisonaiagents
>= 0.13.23, < 1.5.128
1.5.128
Связанные уязвимости
PraisonAIAgents is a multi-agent teams system. Prior to 1.5.128, web_crawl's httpx fallback path passes user-supplied URLs directly to httpx.AsyncClient.get() with follow_redirects=True and no host validation. An LLM agent tricked into crawling an internal URL can reach cloud metadata endpoints (169.254.169.254), internal services, and localhost. The response content is returned to the agent and may appear in output visible to the attacker. This fallback is the default crawl path on a fresh PraisonAI installation (no Tavily key, no Crawl4AI installed). This vulnerability is fixed in 1.5.128.