GHSA-QJ3V-64WJ-Q825
Server-Side Request Forgery (SSRF) via /v1/web/fetch Endpoint
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 0.4.80 | 9router · -20 d desde divulgación | |
| Divulgación | Publicada | GHSA-QJ3V-64WJ-Q825 divulgada · CVSS 7.7 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The `/v1/web/fetch` endpoint allows authenticated (or locally-connected) users to make the server fetch arbitrary URLs via external scraping services (Firecrawl, Jina Reader, Tavily, Exa). There is no blocklist or validation preventing requests to internal network resources, cloud metadata endpoints, or other sensitive internal services. The fetched content is returned to the caller, enabling full read-access SSRF.
Description
The web fetch feature (`/v1/web/fetch`) accepts a user-controlled `url` parameter and passes it to external scraping services (Firecrawl, Jina Reader, Tavily, or Exa) to fetch and extract content. While the URL is validated as a valid URL via `new URL(targetUrl)`, there is no restriction on which hosts or IP ranges can be targeted.
Request Flow
- `src/app/api/v1/web/fetch/route.js` → `src/sse/handlers/fetch.js` → `open-sse/handlers/fetch/index.js`
- The user-provided `url` is passed directly to `handleFetchCore` which dispatches to the configured scraping provider
- Each scraping provider (Firecrawl, Jina, Tavily, Exa) makes an HTTP request to the user-specified URL
- The response content is returned to the caller
No Internal IP Blocklist
The only URL validation in `src/sse/handlers/fetch.js` (line 75-78):
try {
new URL(targetUrl);
} catch {
return errorResponse(HTTP_STATUS.BAD_REQUEST, "Invalid URL format");
}There is no check for:
- Private IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8)
- Cloud metadata endpoints (169.254.169.254, 169.254.170.2)
- Link-local addresses (169.254.0.0/16, fe80::/10)
- Internal DNS names (localhost, *.internal, *.local)
- IPv6 loopback (::1)
Same Issue in Search Endpoint
The `/v1/search` endpoint (`src/sse/handlers/search.js`) has a similar pattern but uses a `query` parameter instead of a URL, which is less directly exploitable for SSRF but still queries external search services.
Evidence
File: `src/sse/handlers/fetch.js` (lines 72-79)
if (!targetUrl || typeof targetUrl !== "string") {
return errorResponse(HTTP_STATUS.BAD_REQUEST, "Missing required field: url");
}
try {
new URL(targetUrl);
} catch {
return errorResponse(HTTP_STATUS.BAD_REQUEST, "Invalid URL format");
}File: `open-sse/handlers/fetch/index.js` — `handleFetchCore` passes `url` directly to scraping APIs without any host/IP validation.
Steps to Reproduce
- Deploy 9Router with a web fetch provider configured (e.g., Jina)
- Send a request targeting an internal service:
- The server fetches the cloud metadata endpoint and returns the IAM credentials
- Alternatively, target internal services:
Impact
- Cloud credential theft: Access to cloud provider metadata APIs (AWS, GCP, Azure) to steal IAM credentials
- Internal service access: Bypass firewall rules to reach internal services not exposed to the internet
- Authentication bypass: The server-side fetch reaches localhost endpoints that may require localhost-only auth
- Port scanning: Enumerate internal services by observing response timing and errors
- Scope changed: The attack affects cloud resources and internal infrastructure beyond the 9Router application itself
Recommended Fix
- Implement an IP address blocklist that rejects private, link-local, loopback, and cloud metadata IP ranges
- Resolve DNS before making the request and validate the resolved IP is not in a blocked range
- Consider using an allowlist of permitted domains instead of a blocklist
- Log all URLs requested through the fetch endpoint
- Rate-limit fetch requests per user/session
### Credits
- Thai Son Dinh from VinSOC Labs (R&D)
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 |
|---|---|---|---|---|
npm9router |
Corregida | 0.4.80 | -20 d | 0.5.119 no afectada |
0.4.720.4.80Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/decolua/9router/security/advisories/GHSA-qj3v-64wj-q825Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
