mcp: advertise OAuth via RFC 9728 protected resource metadata#36669
Draft
bobbyiliev wants to merge 10 commits into
Draft
mcp: advertise OAuth via RFC 9728 protected resource metadata#36669bobbyiliev wants to merge 10 commits into
bobbyiliev wants to merge 10 commits into
Conversation
def-
requested changes
May 21, 2026
Contributor
def-
left a comment
There was a problem hiding this comment.
I added a test that would be important to fix! host injection
2e333ef to
e4ae3fc
Compare
A payload like attacker.example.net" foo=bar smuggles a " into the header value (accepted, HeaderValue::from_str only blocks CR/LF/control bytes), closing the resource_metadata="..." parameter early. An RFC 7235 parser then reads the URL as https://attacker.example.net.
… cache to private
A payload like attacker.example.net" foo=bar smuggles a " into the header value (accepted, HeaderValue::from_str only blocks CR/LF/control bytes), closing the resource_metadata="..." parameter early. An RFC 7235 parser then reads the URL as https://attacker.example.net.
fe2be6c to
f48be5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First step toward letting MCP clients that expect the standard OAuth discovery
flow (Claude Desktop Custom Connectors, ChatGPT remote MCP, etc.) connect to
our MCP endpoints. Per the MCP authorization spec,
the resource server MUST implement RFC 9728 Protected Resource Metadata; this
PR adds that piece and the matching 401 challenge.
Fixes https://linear.app/materializeinc/issue/DEX-31/support-oauth-21-authorization-flow-on-the-mcp-endpoints