Skip to content

fix(security): Scope MCP UI resource caches by server name#3801

Open
charlesvien wants to merge 1 commit into
mainfrom
fix/veria-352-mcp-cache-poisoning
Open

fix(security): Scope MCP UI resource caches by server name#3801
charlesvien wants to merge 1 commit into
mainfrom
fix/veria-352-mcp-cache-poisoning

Conversation

@charlesvien

@charlesvien charlesvien commented Jul 24, 2026

Copy link
Copy Markdown
Member

Problem

Resolves VERIA-352: cross-server MCP UI cache poisoning and capability confusion.

Changes

Key the MCP UI resource caches by (server, uri) so a malicious server can't serve HTML/metadata for a trusted server's resource, and make app tool authorization fail closed so only tools that declared a UI (or opted in with ui.visibility "app") can be invoked from app HTML.

How did you test this?

Unit tests in @posthog/core: cross-server cache isolation, per-server in-flight dedup, and the fail-closed authorization cases.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 315b4a2.

@charlesvien
charlesvien marked this pull request as ready for review July 24, 2026 20:57
@charlesvien charlesvien changed the title scope MCP UI resource caches by server name fix(security): Scope MCP UI resource caches by server name Jul 24, 2026
@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "scope MCP UI resource caches by server n..." | Re-trigger Greptile

@charlesvien
charlesvien force-pushed the fix/veria-352-mcp-cache-poisoning branch from 9e370a3 to cfc8cd8 Compare July 24, 2026 21:38
@charlesvien
charlesvien force-pushed the fix/veria-357-deep-link-host-injection branch from 06757d0 to c22b78a Compare July 24, 2026 21:57
@charlesvien
charlesvien force-pushed the fix/veria-352-mcp-cache-poisoning branch from cfc8cd8 to f9ddf14 Compare July 24, 2026 21:57
@charlesvien
charlesvien force-pushed the fix/veria-357-deep-link-host-injection branch from c22b78a to fa76c61 Compare July 24, 2026 22:01
@charlesvien
charlesvien force-pushed the fix/veria-352-mcp-cache-poisoning branch from f9ddf14 to 65696c3 Compare July 24, 2026 22:01
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 24, 2026
@stamphog

stamphog Bot commented Jul 24, 2026

Copy link
Copy Markdown

Note

🤖 stamphog reviewed 315b4a2e65c3dca6b5620b22afa6eadbe523cf65 — verdict: ESCALATE

This changes MCP resource-cache scoping and tool-call authorization to fix a security vulnerability — squarely security-sensitive surface — but has no independent review; the only signal is a bot reaction, not a substantive approval.

  • 👍 on the PR from greptile-apps[bot].
  • No top-level or inline reviews are present — only a 👍 reaction from greptile-apps[bot], which is weak evidence and not a substantive review with no unresolved concerns.
  • No ownership match and no reported author-familiarity band, so there's no independent-assurance path (owning team or STRONG familiarity) to substitute for a review.
  • The change modifies authorization fail-closed logic and cross-server cache keying for a security fix (VERIA-352) — exactly the kind of auth/security-sensitive surface that requires a human or agent-reviewer sign-off before auto-approval, per policy, regardless of code quality or test coverage.
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 55L, 1F substantive, 237L/2F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1c-medium (237L, 2F, single-area, fix)
stamphog 2.0.0b3 .stamphog/policy.yml @ 9e6e0ca · reviewed head 315b4a2

Updated in place — this replaces 2 earlier stamphog review(s) on this PR.

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 24, 2026
@charlesvien
charlesvien force-pushed the fix/veria-357-deep-link-host-injection branch from fa76c61 to a19203b Compare July 25, 2026 23:50
@charlesvien
charlesvien force-pushed the fix/veria-352-mcp-cache-poisoning branch from 65696c3 to 5dadd74 Compare July 25, 2026 23:50
@charlesvien
charlesvien changed the base branch from fix/veria-357-deep-link-host-injection to main July 25, 2026 23:50
@trunk-io

trunk-io Bot commented Jul 25, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 26, 2026
@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 26, 2026
@charlesvien
charlesvien force-pushed the fix/veria-352-mcp-cache-poisoning branch from 5dadd74 to 315b4a2 Compare July 26, 2026 00:58
@charlesvien charlesvien added the Stamphog This will request an autostamp by stamphog on small changes label Jul 26, 2026
@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 26, 2026
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