GHSA-VC5V-6VWM-WF9M
ZDI-CAN-29369: Hong Kong University Data Intelligence Lab nanobot WebFetch Server-Side Request Forgery Information Disclosure Vulnerability
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 0.3.0 | nanobot-ai · -39 d desde divulgación | |
| Divulgación | Publicada | GHSA-VC5V-6VWM-WF9M divulgada · CVSS 9.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
ZDI-CAN-29369: Hong Kong University Data Intelligence Lab nanobot WebFetch Server-Side Request Forgery Information Disclosure Vulnerability
-- CVSS -----------------------------------------
9.3: AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:N
-- ABSTRACT -------------------------------------
Trend Micro's Zero Day Initiative has identified a vulnerability affecting the following products:
Hong Kong University Data Intelligence Lab - nanobot
-- VULNERABILITY DETAILS ------------------------
* Version tested: nanobot v0.1.4
* Platform tested: macOS 27.3
---
Analysis
Description
HKUDS nanobot, an AI agent framework with multi-platform chat integration, contains a server-side request forgery (SSRF) vulnerability in its web fetching tool. The `_validate_url()` function in `WebFetchTool` checks that URLs use an HTTP/HTTPS scheme and have a non-empty domain, but does not resolve hostnames or validate the target IP address against private, loopback, or link-local ranges. An attacker who can send messages to the bot on any enabled chat channel can instruct it to fetch URLs targeting internal network services, including cloud instance metadata endpoints (169.254.169.254), localhost services, and RFC 1918 private addresses. The HTTP client is configured to follow redirects, enabling redirect-based SSRF bypass. Successful exploitation allows extraction of cloud IAM credentials, internal service enumeration, and access to data from services that trust the server's network identity.
Boundary Crossed
External chat message -> Internal network access (RFC 1918, link-local, cloud metadata)
Root Cause
The `_validate_url()` function at `nanobot/agent/tools/web.py:33-43` validates URLs before the `WebFetchTool` fetches them. The check enforces `http`/`https` scheme and requires a non-empty netloc (domain), but performs no validation against internal/private IP ranges:
def _validate_url(url: str) -> tuple[bool, str]:
"""Validate URL: must be http(s) with valid domain."""
try:
p = urlparse(url)
if p.scheme not in ('http', 'https'):
return False, f"Only http/https allowed, got '{p.scheme or 'none'}'"
if not p.netloc:
return False, "Missing domain"
return True, ""
except Exception as e:
return False, str(e)The following internal targets all pass validation:
- `http://169.254.169.254/` (AWS/GCP/Azure instance metadata)
- `http://127.0.0.1:6379/` (localhost services)
- `http://10.0.0.1/` (RFC 1918 private)
- `http://192.168.1.1/` (RFC 1918 private)
- `http://[::1]/` (IPv6 loopback)
- `http://metadata.google.internal/` (GCP metadata)
Additionally, the `httpx.AsyncClient` is configured with `follow_redirects=True, max_redirects=5` (lines 122-124), enabling redirect-based SSRF bypass. An attacker-controlled URL that returns a 302 redirect to an internal IP will be followed.
The function name and its docstring ("Validate URL: must be http(s) with valid domain") confirm that URL validation was an intentional security consideration, making the absence of internal IP blocking a genuine oversight rather than a design choice.
Attack Vector
- Attacker sends a message to the bot on any enabled chat channel (Telegram, Discord, Slack, etc.). Default configuration allows all senders (no `allow_from` list required).
- The message instructs the LLM to fetch an internal URL:
- The LLM invokes `WebFetchTool.execute(url="http://169.254.169.254/latest/meta-data/iam/security-credentials/")`.
- `_validate_url()` passes the URL (http scheme, non-empty netloc).
- `httpx.AsyncClient.get()` makes an HTTP request to the cloud metadata endpoint from the server's network context.
- The response (containing IAM credentials, instance metadata, or internal service data) is returned to the LLM, which relays it back to the attacker.
Redirect Variant
If direct internal IPs are ever blocked at a network level, the attacker can use redirect-based SSRF:
- Attacker controls `https://attacker.com/redirect` which returns `HTTP 302 Location: http://169.254.169.254/latest/meta-data/`
- Instructs the bot to fetch `https://attacker.com/redirect`
- `httpx` follows the redirect to the internal IP
Impact
- Cloud credential theft: AWS IAM role credentials, GCP service account tokens, Azure managed identity tokens via instance metadata endpoints
- Internal service enumeration: Scan and interact with internal network services (Redis, Elasticsearch, databases, admin panels, Kubernetes API)
- Data exfiltration: Read responses from any internal HTTP service that trusts the server's IP
- Chained attacks: Stolen cloud credentials enable full infrastructure compromise
Proof of Concept
See `poc.py` in this directory. Run with `docker-compose up --build` for a safe test environment.
The PoC:
1. Demonstrates that `_validate_url()` accepts all internal IP ranges
2. Fetches from a mock metadata service simulating AWS EC2 instance metadata
3. Extracts simulated IAM credentials from the response
4. Generates `poc.pcap` capturing the SSRF request/response traffic
-- CREDIT ---------------------------------------
This vulnerability was discovered by:
Peter Girnus (@gothburz) and Project AESIR of TrendAI Zero Day Initiative
-- FURTHER DETAILS ------------------------------
Supporting files:
ZDI-CAN-29369.zip https://github.com/user-attachments/files/25445418/ZDI-CAN-29369.zip
If supporting files were contained with this report they are provided within a password protected ZIP file. The password is the ZDI candidate number in the form: ZDI-CAN-XXXX where XXXX is the ID number.
Please confirm receipt of this report. We expect all vendors to remediate ZDI vulnerabilities within 120 days of the reported date. If you are ready to release a patch at any point leading up to the deadline, please coordinate with us so that we may release our advisory detailing the issue. If the 120-day deadline is reached and no patch has been made available we will release a limited public advisory with our own mitigations, so that the public can protect themselves in the absence of a patch. Please keep us updated regarding the status of this issue and feel free to contact us at any time:
Zero Day Initiative
zdi-disclosures@trendmicro.com
The PGP key used for all ZDI vendor communications is available from:
http://www.zerodayinitiative.com/documents/disclosures-pgp-key.asc
-- INFORMATION ABOUT THE ZDI --------------------
Established by TippingPoint and acquired by Trend Micro, the Zero Day Initiative (ZDI) neither re-sells vulnerability details nor exploit code. Instead, upon notifying the affected product vendor, the ZDI provides its Trend Micro TippingPoint customers with zero day protection through its intrusion prevention technology. Explicit details regarding the specifics of the vulnerability are not exposed to any parties until an official vendor patch is publicly available.
Please contact us for further details or refer to:
http://www.zerodayinitiative.com
-- DISCLOSURE POLICY ----------------------------
Our vulnerability disclosure policy is available online at:
http://www.zerodayinitiative.com/advisories/disclosure_policy/
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
pypinanobot-ai |
Corregida | 0.3.0 | -39 d | 0.4.1 no afectada |
0.3.0Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/HKUDS/nanobot/security/advisories/GHSA-vc5v-6vwm-wf9mLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
