Skip to content

Conversation

@pcarleton
Copy link
Member

@pcarleton pcarleton commented Apr 22, 2025

Motivation and Context

Security requirements / considerations were a few different places, and best-practices was mostly redundant with other spec language.

This promotes Security Requirements to it's own section, and expands a bit more on the motivation behind the mitigations by describing the attack path.

These should mostly be 1:1 to the existing requirements, just with more explanation. The exception is the confused deputy addition which is to address this issue:
#265

I've split 2 other considerations into separate PR's here:

@pcarleton pcarleton requested a review from dsp-ant April 22, 2025 17:45
@dsp-ant dsp-ant force-pushed the davidsp/auth-rs-as-prm branch from 47aab66 to ef76ec2 Compare April 23, 2025 10:50
pcarleton and others added 2 commits April 23, 2025 14:48
Base automatically changed from davidsp/auth-rs-as-prm to main April 23, 2025 17:24
Co-authored-by: Den Delimarsky 🌺 <[email protected]>
1. MCP clients **MUST** implement PKCE according to [OAuth 2.1 section 7.5.2](https://www.ietf.org/archive/id/draft-ietf-oauth-v2-1-12.html#name-countermeasures). PKCE helps prevent authorization code interception attacks by requiring clients to create a secret verifier-challenge pair, ensuring that only the original requestor can exchange an authorization code for tokens.
1. All redirect URIs **MUST** be either `localhost` or use HTTPS to prevent token and code interception.

### 3.3 Open Redirection
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a scenario in Section 4.11.2 of RFC9700 that is directly related to the MCP usage of Dynamic Client Registration.

The attacker could, for example, register a client via dynamic client registration [RFC7591] and execute one of the following attacks:

Intentionally send an erroneous authorization request, e.g., by using an invalid scope value, thus instructing the authorization server to redirect the user agent to its phishing site.
...

There are some recommendations for countermeasures in that section.

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 added a reference to this section in the paragraph below and copied over the "only automatically redirect..." bit (maybe should quote it? lmkwyt)

@pcarleton pcarleton changed the title Authz spec, consolidate security considerations into new section [spec] Auth: consolidate security considerations into new section Apr 24, 2025
localden
localden previously approved these changes Apr 29, 2025
MCP authorization servers SHOULD enforce token expiration and rotation to limit the window of exploitation.

### 3.2 Communication Security
An attacker positioned between MCP clients and MCP servers can intercept tokens via [Man-in-the-Middle (MITM)](https://en.wikipedia.org/wiki/Man-in-the-middle_attack) attacks.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a very compelling sentence, since it doesn't describe the full extent of the risk. I would recommend either removing it entirely so that the text below just points people to OAuth 2.1, or copy the initial paragraph from Section 1.5 inline here.

D-McAdams
D-McAdams previously approved these changes Apr 29, 2025
Copy link

@D-McAdams D-McAdams left a comment

Choose a reason for hiding this comment

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

Aaron just added a few good wordsmithing suggestions. When those are incorporated, it looks good to go.

@localden localden dismissed stale reviews from D-McAdams and themself via 36b3bed April 30, 2025 05:57
localden
localden previously approved these changes Apr 30, 2025
@pcarleton pcarleton merged commit 8976cbd into main Apr 30, 2025
5 checks passed
@pcarleton pcarleton deleted the pcarleton-security-considerations branch April 30, 2025 15:49
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.

6 participants