Skip to content

AS: refuse user information and out-of-range ports in redirect URIs; invalid_client_metadata for post-logout redirect URIs #366

Backlog

Description

@dfcoffin

Found by the round-4 and round-6 reviews of PR #361 (#344). Filed rather than fixed there: it changes behaviour in security-sensitive code (CLAUDE.md review procedure).

ClientMetadataValidator.requireValidRedirectUri (openespi-authserver) checks redirect URIs and post-logout redirect URIs for both the admin client API and RFC 7591 /oauth2/register. It accepts any URI whose host java.net.URI parses. Two forms are still accepted that should not be, and one refusal uses the wrong error code:

  1. User information. https://good.example@evil.example/cb is accepted; its real host is evil.example, so it reads like a redirect to good.example. https://user:pw@tp.example/cb stores credentials in the client registration.
  2. Out-of-range ports. java.net.URI does no range check: https://tp.example:0/cb and https://tp.example:99999/cb are accepted.
  3. Error code for post-logout redirect URIs (round 6). A bad post_logout_redirect_uris value is refused with invalid_redirect_uri, but RFC 7591 §3.2.2 defines that code for redirect_uris only. post_logout_redirect_uris is other metadata (OIDC RP-Initiated Logout), so the refusal should be invalid_client_metadata; a client that maps invalid_redirect_uri to its redirect_uris field points at the wrong field.

Proposed change

  • Refuse a redirect URI (and post-logout redirect URI) with user information (getRawUserInfo() != null), answering 400 with a printable message that does not echo the user information.
  • Refuse a port outside 1-65535 (no port still means the scheme's default).
  • Refuse a bad post-logout redirect URI with invalid_client_metadata (e.g. pass the error code into requireValidRedirectUri); the admin API still answers 400 invalid_request. Update the ClientMetadataValidatorTest cases that expect invalid_redirect_uri for post-logout URIs.
  • Tests under both policies; update OAUTH2_CLIENT_MANAGEMENT_API.md, INTEGRATION_GUIDE.md, openapi.yaml, API_DOCUMENTATION.md.
  • Check the seeds and stored clients for user information or out-of-range ports (see Report registered clients whose stored metadata breaks the shared client rules #365).

Roadmap: #255.

Activity

  1. added a commit that references this issue on Dec 1, 2026
  2. changed the title [-]AS: refuse user information and out-of-range ports in redirect URIs[/-] [+]AS: refuse user information and out-of-range ports in redirect URIs; invalid_client_metadata for post-logout redirect URIs[/+] on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions