Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Closed
#249 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@heskew is already working on this.

Since Oct 1, 2026.

Assessment

This issue has not been assessed yet.

Description

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.

Dominant language
JavaScript
Stars
1
Forks
3
Avg merge
1d 11h
Merged PRs (30d)
28

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HarperFast/oauth

All issues in HarperFast/oauth

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.