fix UI redressing vulnerability#2695
Open
0xcucumbersalad wants to merge 2 commits intodecocms:mainfrom
Open
Conversation
Contributor
🧪 BenchmarkShould we run the Virtual MCP strategy benchmark for this PR? React with 👍 to run the benchmark.
Benchmark will run on the next push after you react. |
Contributor
Release OptionsShould a new version be published when this PR is merged? React with an emoji to vote on the release type:
Current version: Deployment
|
Contributor
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/runtime/src/asset-server/index.ts">
<violation number="1">
P1: Shared asset server stopped sending anti-clickjacking headers on HTML responses, weakening default protection for `createAssetHandler()` consumers.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| @@ -10,6 +10,7 @@ import { resolve, dirname, join, extname, basename, sep } from "path"; | |||
| * hash in the filename changes on every build. | |||
Contributor
There was a problem hiding this comment.
P1: Shared asset server stopped sending anti-clickjacking headers on HTML responses, weakening default protection for createAssetHandler() consumers.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/runtime/src/asset-server/index.ts, line 19:
<comment>Shared asset server stopped sending anti-clickjacking headers on HTML responses, weakening default protection for `createAssetHandler()` consumers.</comment>
<file context>
@@ -10,17 +10,13 @@ import { resolve, dirname, join, extname, basename, sep } from "path";
): Record<string, string> {
if (filePath === indexPath || basename(filePath) === "index.html") {
- return { "Cache-Control": "no-cache", ...SECURITY_HEADERS };
+ return { "Cache-Control": "no-cache" };
}
</file context>
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.
What is this contribution about?
This PR mitigates UI redressing (clickjacking) attacks against the MCP Mesh admin interface by adding
X-Frame-Options: DENYandContent-Security-Policy: frame-ancestors 'none'security headers across all response paths.Without these headers, an attacker could embed the Mesh admin UI inside a malicious page using an
<iframe>, tricking authenticated users into performing unintended actions (e.g., modifying workspace settings, managing MCP servers, or changing access controls) by overlaying invisible frames on top of deceptive UI elements.The fix applies headers at three layers to ensure full coverage:
apps/mesh/src/api/app.ts) — covers all API and server-rendered responsesapps/mesh/src/index.ts) — wraps static asset responses that bypass Hono's middleware pipeline viahandleAssetspackages/runtime/src/asset-server/index.ts) — adds headers directly toindex.htmlcache-control responses so the entrypoint HTML is always protectedHow to Test
bun run devhttp://localhost:3000X-Frame-Options: DENYandContent-Security-Policy: frame-ancestors 'none'<iframe src="http://localhost:3000"></iframe>— the browser should refuse to render itSummary by cubic
Mitigates UI redressing (clickjacking) in the Mesh admin by sending deny‑framing headers on all responses. Blocks iframe embedding to protect authenticated actions.
X-Frame-Options: DENYandContent-Security-Policy: frame-ancestors 'none'viaHonomiddleware for API and server-rendered responses.handleAssetswith the same headers inapps/mesh/src/index.ts.Written for commit c94d214. Summary will update on new commits.