Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add RFC 9728 resource field validation for protected resource metadata discovery #1581

Copy link
Copy link
@maxisbey

Description

@maxisbey
Issue body actions

Problem

PR #1548 implemented SEP-985 fallback discovery but is missing a critical security requirement from RFC 9728 Section 3.3.

RFC 9728 Section 3.3 requires: The resource field in protected resource metadata responses MUST be validated to match the expected resource identifier. If values don't match, the metadata MUST be rejected.

This validation prevents impersonation attacks where a malicious server returns metadata claiming to describe a legitimate resource but containing attacker-controlled authorization servers.

What's Needed

Client must validate:

  1. Same origin validation: Resource field must have same scheme, host, and port as the server
  2. Path validation for path-based discovery: When using /.well-known/oauth-protected-resource/{path}, the resource field must match or be a valid parent of the expected path
  3. Fallback on mismatch: Reject invalid metadata and try the next discovery URL in the fallback chain

Related

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Significant bug affecting many users, highly requested featureSignificant bug affecting many users, highly requested featureauthIssues and PRs related to Authentication / OAuthIssues and PRs related to Authentication / OAuthbugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.