GHSA-6WHM-VQ2P-8M93
SSRF in auth.oauth2 module via unvalidated token_url (readable, IAM credential theft)
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-6WHM-VQ2P-8M93 divulgada · CVSS 8.5 (GitHub) | |
| Remediación | Parche 2.26.11 | flyto-core · 0 d desde divulgación | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
## Summary
The `auth.oauth2` module POSTs to a caller-supplied `token_url` through a plain `aiohttp.ClientSession` with no SSRF validation whatsoever, and reflects the response body back to the caller. An authenticated recipe/workflow author can force the server to issue arbitrary HTTP(S) requests to internal services and cloud metadata endpoints and read the responses.
## Root Cause
`src/core/modules/atomic/auth/oauth2.py` builds a request to `token_url` and issues `session.post(token_url, data=body, headers=headers, ssl=True)` at lines 359-363. The file contains zero SSRF-guard symbols (`enforce_outbound_url`, `validate_url`, `guarded_*`). The security-hardening commit `0a0a528` (which added `enforce_outbound_url`/guarded sessions to the enumerated HTTP and notification modules) never touched `oauth2.py`. `ssl=True` does not constrain an `http://` target — the TLS flag is ignored for non-TLS scheme URLs, so `http://169.254.169.254/...` is reachable. The response `status`/`raw`/`error` are surfaced to the caller (oauth2.py:391-394, 408), making this a readable SSRF.
## Impact
Authenticated (PR:L) SSRF with response reflection. An attacker reads cloud instance-metadata (e.g. AWS IMDS IAM credentials), internal-only HTTP APIs, and can drive internal GET/POST bodies. Confidentiality impact is high (credential/secret theft); scope is Changed (crosses from the module sandbox authority into internal/metadata network authority).
## Proof of Concept
Authenticated `POST /mcp` execute_module `auth.oauth2` with:
`{"token_url":"http://169.254.169.254/latest/meta-data/iam/security-credentials/", "grant_type":"client_credentials", "client_id":"a"}`
→ the metadata JSON is returned in the module result `raw` field.
## Attack Chain
1. Entry: authed POST /mcp execute_module `auth.oauth2`, params `{token_url:"http://169.254.169.254/latest/meta-data/iam/security-credentials/", grant_type:"client_credentials", client_id:"a"}`.
Guard: `require_auth` (api/routes/mcp.py:73, api/security.py:121) — passes with a workflow-author token (PR:L). Schema regex `^https?://.+` (oauth2.py:110) — matches.
Bypass proof: regex only enforces scheme, not host.
2. Check: `enforce_module_policy` (module_policy.py) — `auth.*` not in `_DEFAULT_DENYLIST`; no dangerous permission declared → allowed under default config (verified empirically: 0 blocked of 25 target modules).
3. Check: SSRF guard.
Bypass proof: `grep -n "enforce_outbound_url|validate_url|guarded" oauth2.py` → 0 matches.
4. Sink: `session.post(token_url, ssl=True)` at oauth2.py:359 fires against `http://169.254.169.254/...` (ssl=True ignored for http scheme).
5. Impact: metadata JSON returned in module result (`raw`/`error`) → IAM credential theft; general internal-service reader.
## Bypass Evidence
`grep -n "enforce_outbound_url|validate_url|guarded" src/core/modules/atomic/auth/oauth2.py` → exit 1 (no matches). Contrast `graphql.query`/`http.get`, which DO call the guard. `git show 0a0a528 --stat` does not list oauth2.py.
## Affected Versions
`flyto-core <= 2.26.10` (vulnerable sink present on the v2.26.10 release tag; HEAD's later commits do not touch oauth2.py).
## Suggested Fix
Route the request through the existing `guarded_client_session`/`guarded_aiohttp_request` helpers (as `http.get` does), and call `enforce_outbound_url(token_url)` before the request. Do not reflect raw internal responses to the caller.
---
Reported by zx (Jace) — GitHub: @manus-use
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 |
|---|---|---|---|---|
pypiflyto-core |
Corregida | 2.26.11 | 0 d | 2.41.0 no afectada |
2.26.11Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/flytohub/flyto-core/security/advisories/GHSA-6whm-vq2p-8m93Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
