Skip to content

fix: reject MCP requests from unapproved browser origins - #2657

Open
erichare wants to merge 5 commits into
fix/mcp-request-isolationfrom
fix/mcp-origin-allowlist
Open

erichare wants to merge 5 commits into
fix/mcp-request-isolationfrom
fix/mcp-origin-allowlist

Conversation

@erichare

@erichare erichare commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does:

Checks browser origins on the registered MCP transport routes before authentication. Approved browsers can complete preflight and read the challenge. The allowlist starts empty. Ordinary REST collections, including those in a keyspace named mcp, keep their existing behavior.

Which issue(s) this PR fixes:

Part of #2630. Public browser qualification is tracked in #2634. Builds on #2656 and is the base for #2659. Full stack.

Verification

71 focused Java tests passed on JDK 25 at 3467041f7. The checks cover preflight, exact origin matching, and startup validation. GitHub checks.

./mvnw -o -B -ntp clean test \
  -DskipITs -Dfmt.skip=true -Dxml-format.skip=true -Dsurefire.failIfNoSpecifiedTests=false \
  -Dquarkus.http.test-port=19281 -Dtest=McpOriginFilterTest,McpOriginPolicyTest,McpOriginDefaultPolicyTest,McpProtocolTest,McpEndpointConfigSourceFactoryTest

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

📈 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 57.12%
This PR 58.33%
Delta 🟢 +1.21%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Unit Test Coverage Report

Overall Project 58.33% -0.12% 🍏
Files changed 58.31% ❌

File Coverage
McpEndpointConfigSourceFactory.java 98.94% 🍏
McpOriginFilter.java 43.4% -56.6% ❌

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

📉 Integration Test Coverage Delta vs Main Branch (dse69-it)

Metric Value
Main Branch 72.75%
This PR 72.74%
Delta 🔴 -0.01%
⚠️ Coverage decreased

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (dse69-it)

Overall Project 72.74% -0.17% 🍏
Files changed 39.5% ❌

File Coverage
McpEndpointConfigSourceFactory.java 74.47% -13.83% 🍏
McpOriginFilter.java 28.57% -70.17% ❌

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

📉 Integration Test Coverage Delta vs Main Branch (hcd-it)

Metric Value
Main Branch 74.21%
This PR 74.19%
Delta 🔴 -0.02%
⚠️ Coverage decreased

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (hcd-it)

Overall Project 74.19% -0.17% 🍏
Files changed 39.5% ❌

File Coverage
McpEndpointConfigSourceFactory.java 74.47% -13.83% 🍏
McpOriginFilter.java 28.57% -70.17% ❌

@erichare
erichare force-pushed the fix/mcp-origin-allowlist branch from 1ee0c3a to 7dfbc92 Compare November 19, 2026 05:41

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant