A declared redirect-host allowlist that resolves empty means no restriction

Chiusa
#249 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@heskew ci sta già lavorando.

Dal 1/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

A declared redirect-host allowlist that resolves to an empty list is treated as "no restriction" instead of failing closed.

normalizeMcpSecurityConfig (src/lib/config.ts) filters mcp.dynamicClientRegistration.allowedRedirectUriHosts and mcp.clientIdMetadataDocuments.allowedHosts down to non-empty entries. A declared value whose entries all resolve blank therefore normalizes to [], for example:

  • an env placeholder that expands to "" (docker-compose X=${X} with X unset)
  • whitespace-only entries

validateRedirectUri (src/lib/mcp/clientValidator.ts) reads an empty or absent list as "no allowlist" (allowedHosts && allowedHosts.length > 0 && ...). So the operator declared a restriction and gets none. A declared CIMD allowedHosts that resolves empty has the same effect for interactive CIMD clients. The headless client_credentials path already refuses an empty list.

This is the same fail-open shape that #240 and #207 closed for initialAccessToken and the MCP feature booleans (HarperFast/oauth#247).

Fix: when MCP is enabled and the key is declared, but the list is empty after normalization, throw at startup naming the key. That matches the fail-closed handling of the other fields. Omitting the key keeps the documented "no allowlist" default. Raised in review of #247 and deliberately left out of it.

Lingua principale
JavaScript
Stelle
1
Fork
3
Merge medio
6h 48m
PR unite (30g)
25

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di HarperFast/oauth

Tutte le issue di HarperFast/oauth

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.