GHSA-CC9W-6W4G-HQV7
Password-gated OAuth: authorization code is redeemable without the password
Texto original en inglés · Ver en español
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-CC9W-6W4G-HQV7 divulgada · CVSS 9.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Impact
Anyone who can reach a server started with `MCP_AUTH_TOKEN` set can obtain a valid access token without knowing the password, and then has full vault access through every MCP tool (read, write, delete), within whatever `READ_ONLY` / `WRITE_FOLDERS` allow.
Cause (`src/auth.ts`, `mountPasswordAuth`)
- `GET /oauth/authorize` generates the authorization `code`, stores it in `pendingAuths`, and renders it into the password page as a hidden form field, before any password has been entered.
- `POST /oauth/token` (`grant_type=authorization_code`) accepts any code present in `pendingAuths` whose `client_id`, `redirect_uri` and PKCE verifier match. All three are chosen by the caller. Nothing records whether `POST /oauth/approve` (the password check) ever succeeded for that code.
Reproduction (v0.7.0 from npm, filesystem mode, `MCP_AUTH_TOKEN` set, bound to localhost)
- `POST /oauth/register` with `{"redirect_uris": ["http://localhost:9/callback"], "token_endpoint_auth_method": "none"}` returns a `client_id`.
- Generate a PKCE verifier and its S256 challenge. `GET /oauth/authorize?client_id=…&redirect_uri=http://localhost:9/callback&code_challenge=…&code_challenge_method=S256&state=x` returns 200 with the password page. Read the `code` from `<input type="hidden" name="code" value="…">`.
- Without calling `/oauth/approve`: `POST /oauth/token` (form-encoded) with `grant_type=authorization_code`, that `code`, the `client_id`, the `code_verifier` and the `redirect_uri` returns 200 with an `access_token`.
- `POST /mcp` `initialize` with `Authorization: Bearer <access_token>` returns 200. (Control: a made-up bearer token gets 401.)
Patches
Fixed in 0.7.1. `/oauth/token` now requires that the password step completed before a code can be redeemed — an `approved` flag set only after the password check — with a regression test covering token-exchange-before-approve.
Remediation
- Upgrade to 0.7.1 immediately if you run with `MCP_AUTH_TOKEN` set.
- The bug does not disclose your password, so rotating it isn't required. Tokens issued before upgrading remain valid until they expire (access ~1h, refresh up to 14 days); to revoke them, clear the OAuth token store (`auth-tokens.json`) and restart.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npmobsidian-sync-mcp |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/es617/obsidian-sync-mcp/security/advisories/GHSA-cc9w-6w4g-hqv7Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
