Repository navigation
[2.1] Fixes 38479: Enforce RFC 8707 resource parameter and aud binding in MCP OAuth - #38996
Merged
Merged
Conversation
…CP OAuth (#38695) * Fix #38479: Enforce RFC 8707 resource parameter and aud binding in MCP OAuth Validate RFC 8707 resource indicators against the server's canonical protected resource URI on /mcp/authorize and /mcp/token (both authorization_code and refresh_token grants), bind minted MCP OAuth access tokens via the JWT aud claim, and enforce aud matching on OpenMetadata-signed JWTs at /mcp while preserving backward compatibility for clients that omit resource and for PAT, bot, session, and IdP tokens. Signed-off-by: deepinsight coder <nrvamsi13@gmail.com> * Reject MCP-audience tokens at the REST and WebSocket entry points The access tokens the MCP OAuth server mints name /mcp in aud, but the REST filter and the push-feed handshake accepted them like any other OpenMetadata-signed token. Move the audience rule into TokenAudience and have JwtFilter apply it while verifying every OpenMetadata-signed token, so filter, getCatalogSecurityContext, validateJwtAndGetClaims, verifySignatureOnly and validatePrefixedTokenRequest all enforce it. A JwtFilter serves the OpenMetadata API unless it is built with a TokenAudience, and no audience names the API, so REST and the push feed answer an MCP access token with a 401. The MCP transport and McpServer build their filters for the protected resource the transport publishes, which replaces the transport's own copy of the check. Tokens without aud (login and session tokens, bot tokens, personal access tokens, MCP tokens minted before audience binding) behave as before everywhere. * Cover the MCP token audience across MCP, REST and the push feed Mint an access token through a refresh grant on /mcp/token and check it is accepted at /mcp and refused with 401 by /api/v1/users/loggedInUser and by the push-feed handshake, with the token in the header or the query. Login, bot and personal access tokens keep working on all three. * Record where each entry point checks the token audience Update the RFC 8707 decision record: the audience rule lives in TokenAudience and JwtFilter applies it on every entry point, REST and the push feed refuse aud-bound tokens, /mcp accepts tokens for its own resource, and tokens without aud keep working everywhere. * Fail MCP OAuth token exchange for an invalid resource --------- Signed-off-by: deepinsight coder <nrvamsi13@gmail.com> Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com> Co-authored-by: Vishnu Jain <vishnujtimes@gmail.com> (cherry picked from commit 9078572)
gh-bot-collate
Bot
requested review from
manerow
and removed request for
a team
November 27, 2026 13:32
Author
|
🤖 This backport will not merge itself: |
15 tasks done
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.
Automated backport of #38695 to
2.1.9078572c338c26717d3c82ceb7bada5e56ba085amain.Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #38695 is asked to look.
resolver run