GHSA-qg25-6gc4-48mg CVE-2026-61430 PYSEC-2026-4272
PraisonAI: DNS rebinding bypass in `web_crawl` SSRF protection allows internal response disclosure
- Severity
- 8.4 / 10
- High · CVSS 4.0
- Exploit chance (EPSS)
- 0.25%
- Chance of exploitation in the next 30 days. Higher than 16.90% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-200 Exposure of Sensitive Information to an Unauthorized Actor
- CWE-367 Time-of-check Time-of-use (TOCTOU) Race Condition
- CWE-918 Server-Side Request Forgery (SSRF)
- Fix
1.6.78- Upgrade praisonaiagents to this version or later
Description
Summary
PraisonAI's web_crawl agent tool performs a server-side HTTP fetch of an agent/attacker-influenced URL. SSRF is meant to be prevented by _is_safe_crawl_url(), which resolves the hostname and rejects private/loopback/link-local IPs at validation time. The validated value is the URL string (not a pinned IP); the fetch backend then re-resolves the hostname at connection time. Because validation and connection perform two independent DNS resolutions, a DNS-rebinding domain that returns a public IP during validation and an internal IP during the fetch fully bypasses the guard, and the internal HTTP response body is returned to the caller.
This is SSRF with internal response disclosure (read-back) — not blind SSRF. Runtime-confirmed against PraisonAI 4.6.63; the crawl response returned the controlled internal markers PRAISONAI_INTERNAL_SECRET_CANARY_7f3a91 / FAKE_INTERNAL_TOKEN_DO_NOT_USE_7f3a91. Severity High. Reachable by any actor who can influence the URL an agent crawls (e.g. a chat/bot/agent surface).
Details
Affected component
- Package:
praisonaiagents(PraisonAI), version 4.6.63. - File:
src/praisonai-agents/praisonaiagents/tools/web_crawl_tools.py; toolweb_crawl/crawl_web(part of the default bot tool set).
Vulnerable code / root cause
Code point 1 — check-time-only DNS validation, no IP pinning
Path:
src/praisonai-agents/praisonaiagents/tools/web_crawl_tools.py
Function:
_is_safe_crawl_url
Snippet:
for info in socket.getaddrinfo(hostname, None): # resolve at CHECK time
ip = ipaddress.ip_address(info[4][0])
if (ip.is_loopback or ip.is_private or ip.is_link_local
or ip.is_multicast or ip.is_unspecified):
return False
return True
Issue: the guard validates the hostname by resolving it once at check time. It does not pin the resolved IP and does not return/forward that IP to the HTTP client. Any later resolution can differ.
Code point 2 — guard runs, then the URL string is handed to the backend
Function:
web_crawl
Snippet:
for u in raw_url_list:
if _is_safe_crawl_url(u): # validate the URL string
url_list.append(u)
...
results = _crawl_with_httpx(url_list) # or _crawl_with_crawl4ai(url_list)
Issue: attacker-controlled input (urls) is validated as a string; the backend then fetches that string and re-resolves DNS independently of the guard. There is no shared, pinned IP between check and fetch.
Code point 3 — _crawl_with_httpx backend re-resolves (redirect re-validation does not stop rebinding)
Function:
_crawl_with_httpx
Snippet:
with httpx.Client(follow_redirects=False, timeout=30.0) as client:
for _ in range(max_redirects + 1):
if not _is_safe_crawl_url(current): # re-resolves hostname (CHECK)
raise ValueError("Redirect target failed SSRF validation")
response = client.get(current) # resolves AGAIN at CONNECT
Issue: even with per-hop redirect re-validation, _is_safe_crawl_url(current) and client.get(current) are two separate DNS resolutions of the same hostname. A rebinding domain answers public to the check and internal to the connect → TOCTOU bypass. No IP pinning.
Code point 4 — urllib fallback (same function), no per-hop guard
Snippet:
import urllib.request
with urllib.request.urlopen(url, timeout=30) as response: # re-resolves + auto-follows redirects
content = response.read().decode('utf-8', errors='ignore')
Issue: when httpx is not installed, this fallback inside _crawl_with_httpx fetches the URL and auto-follows redirects with no per-hop/per-connect validation. (Results from this function are labelled "provider": "httpx" regardless of which path runs.)
Code point 5 — crawl4ai/Chromium backend (confirmed addendum)
The crawl4ai backend (_crawl_with_crawl4ai → crawler.arun(url=url), headless Chromium) is also runtime-confirmed affected (browser re-resolves DNS / follows redirects with no per-connect guard). To keep this report focused on the web_crawl SSRF guard, the backend-specific evidence is in SSRF-04_Crawl4AI_SSRF_Backend_Addendum.md.
Attack flow
- Attacker controls a hostname (e.g.
rebind.lab) whose authoritative DNS rebinds. - Lookup #1 (the guard) → a public IP →
_is_safe_crawl_url()returns true. - The backend re-resolves → the attacker's DNS now answers an internal/private IP (cloud metadata, loopback, internal service).
- The backend connects to the internal service and returns its body to the caller → internal data disclosure.
Why existing protection is bypassed
- The guard validates the hostname, not a pinned IP; check and connect resolve independently → DNS rebinding (TOCTOU) defeats it on every backend.
- Redirect re-validation (httpx path) re-checks the hostname but still re-resolves at connect, so it does not stop rebinding; the urllib fallback and crawl4ai backends have no per-hop guard at all.
Security boundary
The server-side fetch reaches internal/loopback/metadata services not exposed to the attacker and returns their content (CVSS Scope: Changed). Reachable wherever an agent can be induced to crawl an attacker-supplied URL (PR:L). An unauthenticated single-request path to web_crawl read-back was not found in 4.6.63 (so PR:N / Critical is not claimed).
Proof of Concept
Environment
Real PraisonAI 4.6.63 in a local Docker runtime; a controlled internal canary service (Docker-internal only, not published) returns synthetic markers; a controlled DNS responder implements rebinding for rebind.lab. No public host / real metadata / real secret. Runnable assets: PraisonAI-Runtime-Repro\runtime-files\.
Steps to reproduce
- Burp Repeater tab
PRAI-05-01-DNS-Rebind-Trigger→127.0.0.1:18080:
POST /tool/web_crawl HTTP/1.1
Host: 127.0.0.1:18080
Content-Type: application/json
{"url":"http://rebind.lab:8081/secret"}
- Send (
PRAI-05-02-DNS-Rebind-Secret-Readbackcaptures the response). If a send returns the "blocked" error, the rebinding DNS auto-resets (~3s) — resend. - Redirect variant:
PRAI-05-03-Redirect-Trigger/PRAI-05-04-Redirect-Secret-Readbacksend{"url":"http://redirector:8082/redirect-to-internal"}.
Expected result
A safe SSRF guard refuses destinations that resolve to internal/private IPs regardless of DNS timing or redirects, and does not return internal content.
Actual result
HTTP 200 with the internal body in the crawl result. Primary evidence is the provider: "httpx" backend returning the internal canary via DNS rebinding:
{"input_url":"http://rebind.lab:8081/secret",
"result":{"content":"{ ... \"secret\": \"PRAISONAI_INTERNAL_SECRET_CANARY_7f3a91\", \"token\": \"FAKE_INTERNAL_TOKEN_DO_NOT_USE_7f3a91\" ... }","provider":"httpx"}}
The redirect variant returns the same internal markers via a redirect chain (provider: "httpx").
Screenshots
DNS rebinding read-back
The attacker-controlled rebind.lab URL is accepted by web_crawl, and the PraisonAI response contains the internal canary response body.
<img width="1543" height="785" alt="01-DNS-Rebind-Burp-Readback" src="https://github.com/user-attachments/assets/e86e95dd-3d3a-4bef-b1c6-cb897234a212" />
DNS rebinding runtime evidence
The runtime log shows rebind.lab first resolving to an allowed/public IP during validation (guard-pass), then resolving to an internal Docker IP during the actual fetch (fetch-hit). The internal canary receives GET /secret from the PraisonAI container.
<img width="1654" height="828" alt="02-DNS-Rebind-DNS-Log-And-Internal-Hit" src="https://github.com/user-attachments/assets/f1d28046-de34-48f0-9bee-bbe26e598d5f" />
Redirect-based SSRF read-back
The attacker-controlled redirector URL is accepted by web_crawl. PraisonAI follows the redirect and returns the internal canary response body containing PRAISONAI_INTERNAL_SECRET_CANARY_7f3a91.
<img width="1540" height="772" alt="03-Redirect-Burp-Readback" src="https://github.com/user-attachments/assets/79eec159-4b9f-44be-a9eb-b15aba35ead8" />
Redirect chain runtime evidence
The controlled redirector returns 302 -> http://internal-canary:8081/secret, and the internal canary receives GET /secret, confirming that the server-side client followed the redirect into the internal network.
<img width="1637" height="894" alt="04-Redirect-Internal-Hit-Log" src="https://github.com/user-attachments/assets/1c503e30-9d01-4d32-8658-497f755a969e" />
Reproduction assets
The attached archive contains the local Docker runtime used to reproduce the issue with controlled canary services only. It does not contain real secrets, real cloud metadata access, or third-party API keys.
Impact
SSRF against internal/loopback/cloud-metadata endpoints with disclosure of internal HTTP responses (read-back) to the attacker. Bypasses the project's SSRF protection on every fetch backend.
Suggested remediation
- Resolve the host once, reject all returned records that are private/loopback/link-local/ULA/CGNAT/metadata, then connect to that exact validated IP (pin it; send the original
Host). Do not let the HTTP client / browser re-resolve. - Apply the same validation + IP pinning to every backend (httpx, urllib fallback, crawl4ai) and every redirect hop.
- Disable automatic redirect following (or cap + re-validate each hop with pinning).
- Treat IPv4-mapped IPv6, decimal/octal/hex IPs, and CGNAT/non-global ranges as unsafe.
Affected versions
PyPI
| Package | Vulnerable | Fixed in |
|---|---|---|
| praisonaiagents | < 1.6.78 |
1.6.78 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
praisonaiagents PyPI → 1.6.78
- pip
pip install --upgrade "praisonaiagents>=1.6.78"- poetry
poetry add "praisonaiagents>=1.6.78"- uv
uv add "praisonaiagents>=1.6.78"
Severity breakdown
CVSS 4.0 8.4
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:N/SC:H/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- Low
- User interaction
- None
- Confidentiality (vulnerable system)
- High
- Integrity (vulnerable system)
- Low
- Availability (vulnerable system)
- None
- Confidentiality (subsequent systems)
- High
- Integrity (subsequent systems)
- Low
- Availability (subsequent systems)
- None
- Exploit maturity
- Not defined
- Scope
- X
CVSS 3.1 8.5
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Changed
- Confidentiality
- High
- Integrity
- Low
- Availability
- None
Weakness
CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
How to prevent it
- Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.
How to prevent it
- Implementation: The most basic advice for TOCTOU vulnerabilities is to not perform a check before the use. This does not resolve the underlying issue of the execution of a function on a resource whose state and identity cannot be assured, but it does help to limit the false sense of security given by the check.
- Implementation: When the file being altered is owned by the current user and group, set the effective gid and uid to that of the current user and group when executing this statement.
- Architecture and Design: Limit the interleaving of operations on files from multiple processes.
- Implementation, Architecture and Design: If you cannot perform operations atomically and you must share access to the resource between multiple processes or threads, then try to limit the amount of time (CPU cycles) between the check and use of the resource. This will not fix the problem, but it could make it more difficult for an attack to succeed.
- Implementation: Recheck the resource after the use call to verify that the action was taken appropriately.
- Architecture and Design: Ensure that some environmental locking mechanism can be used to protect resources effectively.
- Implementation: Ensure that locking occurs before the check, as opposed to afterwards, such that the resource, as checked, is the same as it is when in use.
CWE-918: Server-Side Request Forgery (SSRF)
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-gxmw-5f7x-6g22 praisonaiagents vulnerable to arbitrary file write via unsanitized `user_id` in `FileMemory.__init__()` — path traversal to any writable location | High | Also affects praisonaiagents |
| GHSA-cfxv-8fw8-rwpv praisonaiagents: ast_grep_rewrite rewrites arbitrary files without the @require_approval gate enforced on every sibling mutation tool | Medium | Also affects praisonaiagents |
| GHSA-x44h-65qv-cw74 praisonaiagents has an SSRF protection bypass in `spider_tools._host_is_blocked()` via DNS-resolved hostnames (`127.0.0.1.nip.io`) | High | Also affects praisonaiagents |
| GHSA-7g3p-92qq-8wvh praisonaiagents: AgentServer declares auth_token but never enforces it on any route | High | Also affects praisonaiagents |
| GHSA-5r34-2g38-6569 praisonaiagents web_crawl vulnerable to SSRF via redirect-following | High | Also affects praisonaiagents |
| GHSA-vg6p-v9vm-6fgj praisonaiagents vulnerable to SSRF in web_crawl tool via redirect-following and DNS rebinding (validate-then-fetch gap) | High | Also affects praisonaiagents |
| GHSA-8hjw-25cg-g52h praisonaiagents has a `web_crawl` SSRF protection bypass via unchecked redirect targets | High | Also affects praisonaiagents |
| GHSA-hxmv-c4g6-5fqc PraisonAI workflow include bypasses tools.py autoload opt-in and executes included recipe code | High | Also affects praisonaiagents |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor