Skip to content

Conversation

@pcarleton
Copy link
Member

@pcarleton pcarleton commented Aug 4, 2025

see #991

This attack is concerning because the server sees the correct metadata
document and the user sees the correct client name, making detection
difficult. While platform-specific attestations (iOS DeviceCheck, Android
Play Integrity) could address this, they're not universally available. An
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's expand on this and describe how an app developer can run a backend service that validates the DeviceCheck/Play Integrity signatures and returns a JWT the app can use with the private_key_jwt client authentication method. This would actually be a pretty reasonable level of assurance of the app's identity. This doesn't need to be specified normatively in this proposal, since the actual underlying OAuth mechanism used is only the private_key_jwt auth method.

Copy link
Contributor

@PieterKas PieterKas Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the normative text can be left in the IETF draft, and we can just normatively reference that instead and outline the concept of using "private_key_jwt" here. Alternatively we can add a section to talk about client authentication as a core part of the spec, and not just as a mitigation in this section.

Proposing some expanded text below.

Co-authored-by: PieterKas <[email protected]>
Co-authored-by: Aaron Parecki <[email protected]>
Copy link
Contributor

@tnorimat tnorimat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added explicit authentication prompt and user credential steps to the sequence diagram for clarity. Improved wording regarding OAuth 2.0 Dynamic Client Registration Protocol support.

```json
{
"client_id": "https://app.example.com/oauth/client-metadata.json",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there some kind of validation we could use? could jus t people impersonate any client there?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

someone running software bound on localhost can impersonate another client running on localhost. Solving that requires more work, but is not different from DCR today. there's a longer write up in the blog about this topic: https://blog.modelcontextprotocol.io/posts/client_registration/#challenge-2-client-identity-and-impersonation


MCP supports three client registration mechanisms. Choose based on your scenario:

- **Client ID Metadata Documents**: When client and server have no prior relationship (most common)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how are clients choosing the approach to use? is there any concept of priority?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally the way I see clients doing this is:

  1. If they have a pre-registered credential available, use that
  2. If not, use CIMD if supported
  3. If not, use DCR if supported
  4. If not, prompt user that they can't connect / they need to go pre-register a client

This would probably be good to explicitly spell out

[Server-Side Request Forgery (SSRF)](https://developer.mozilla.org/docs/Web/Security/Attacks/SSRF) attacks,
as well as against being used as Denial of Service (DoS) amplifiers:

- Validate URLs and resolved IP addresses before fetching
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what kind of validation are we talking about? block some ip ranges?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea good question, I wonder if we want to just link to the CIMD RFC rather than spelling this all out here as well.

https://datatracker.ietf.org/doc/html/draft-ietf-oauth-client-id-metadata-document-00#section-6.5

Authorization servers fetching the client metadata document and resolving URLs located in the metadata document should be aware of possible SSRF attacks. Authorization servers SHOULD avoid fetching any URLs using private or loopback addresses and consider network policies or other measures to prevent making requests to these addresses. Authorization servers SHOULD also be aware of the possibility that URLs might be non-http-based URI schemes which can lead to other possible SSRF attack vectors.


#### Example Metadata Document

```json
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about private_key_jwt? can you show an example?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather leave that to the CIMD RFC

@pcarleton pcarleton enabled auto-merge (squash) November 14, 2025 16:09
@pcarleton pcarleton disabled auto-merge November 14, 2025 16:12
@pcarleton pcarleton merged commit 5f1d3ff into main Nov 14, 2025
6 checks passed
@pcarleton pcarleton deleted the pcarleton/client-id-metadata-document branch November 14, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SEP-991: Enable URL-based Client Registration using OAuth Client ID Metadata Documents

8 participants