Skip to content

[2.1] Fixes 38479: Enforce RFC 8707 resource parameter and aud binding in MCP OAuth - #38996

Merged
Vishnuujain merged 1 commit into
2.1from
backport/2.1/pr-38695
Nov 27, 2026
Merged

Vishnuujain merged 1 commit into
2.1from
backport/2.1/pr-38695

Conversation

@gh-bot-collate

Copy link
Copy Markdown

Automated backport of #38695 to 2.1.

Source PR #38695
Author @Vamsi-klu
Merge commit 9078572c338c26717d3c82ceb7bada5e56ba085a
Method Clean cherry-pick — identical to the commit on main.

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

…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
gh-bot-collate Bot requested a review from a team as a code owner November 27, 2026 13:32
@gh-bot-collate
gh-bot-collate Bot requested review from manerow and removed request for a team November 27, 2026 13:32
@gh-bot-collate gh-bot-collate Bot added the safe to test Add this label to run secure Github workflows on PRs label Nov 27, 2026
@gh-bot-collate

Copy link
Copy Markdown
Author

🤖 This backport will not merge itself: 2.1 has no required status checks, so there is nothing for auto-merge to wait on. Merge it by hand once CI is green.

@Vishnuujain
Vishnuujain merged commit b0b2ba5 into 2.1 Nov 27, 2026
47 checks passed
@Vishnuujain
Vishnuujain deleted the backport/2.1/pr-38695 branch November 27, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants