Skip to content

fix(auth): accept same-origin issuers at any address - #1467

Open
DaleSeo wants to merge 2 commits into
mainfrom
fix/same-origin-issuer
Open

DaleSeo wants to merge 2 commits into
mainfrom
fix/same-origin-issuer

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Motivation and Context

Following up on #1393, OAuth discovery now accepts an authorization server on the resource’s own origin, regardless of its IP address type.

How Has This Been Tested?

Added tests

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@github-actions github-actions Bot added T-core Core library changes T-transport Transport layer changes labels Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@michaelneale is on triage rotation this week and is the reviewer for this one.

Labels come from the PR labeler. Please review the change.

Automated triage. Labels are a first pass and the assigned maintainer has the final say.

@DaleSeo
DaleSeo marked this pull request as ready for review November 16, 2026 20:04
@DaleSeo
DaleSeo requested a review from a team as a code owner November 16, 2026 20:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T14:45:17.134788Z 7d46443 New commits
🔒 Security Review ✅ Completed 2026-11-20T14:47:46.942620Z 7d46443 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DaleSeo DaleSeo self-assigned this Nov 16, 2026
tsarlandie-oai
tsarlandie-oai previously approved these changes Nov 20, 2026

@tsarlandie-oai tsarlandie-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread crates/rmcp/src/transport/auth.rs Outdated
return false;
}

if Self::is_same_origin(base_url, url) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the resource uses HTTP, a same-origin private issuer also passes this check over HTTP. Could we require HTTPS for the new non-loopback issuer exception and add a same-origin HTTP rejection case? MCP communication security

Comment thread crates/rmcp/src/transport/auth.rs Outdated
#[case::cgnat("https://100.64.0.1", "https://100.64.0.1", false, true)]
#[case::mapped_ipv4("https://[::ffff:a00:1]", "https://[::ffff:a00:1]", false, true)]
#[case::nat64("https://[64:ff9b::a00:1]", "https://[64:ff9b::a00:1]", false, true)]
#[case::link_local("https://[fe80::1]", "https://[fe80::1]", false, true)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The constructor promises to reject link-local and reserved addresses. Could we limit the issuer exception to AddressClass::Private and keep Blocked rejected? If the configured literal is intentionally exempt, please document that exception. Constructor contract · MCP address guidance

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch. The exception now only widens allow_private at the issuer check, so it allows AddressClass::Private while keeping Blocked rejected, as the constructor docs promise.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants