Claude skill clickjacking protection security — SA-SKL-CLICKJACK
Clickjacking attacks embed a skill's legitimate UI inside a transparent or opaque iframe on an attacker-controlled page, then trick users into clicking buttons they cannot see — confirming OAuth grants, installing skills, deleting accounts, or approving payments. The defense requires both server-side framing headers (X-Frame-Options or CSP frame-ancestors) and awareness of the cases where those headers are insufficient: deprecated ALLOW-FROM support, subdomain-takeover bypass, and frameable confirmation dialogs. SA-SKL-CLICKJACK-001 through CLICKJACK-004 cover the four most common gaps in community MCP skill audits.
Why framing protection matters for MCP skill install flows
MCP skills that expose OAuth authorization pages, skill installation confirmation dialogs, or account management UIs are high-value clickjacking targets. An attacker who convinces a Claude user to visit a malicious page and click anywhere on it can invisibly pass those clicks through to the transparent skill UI iframe underneath — granting OAuth access, installing a malicious skill, or deleting account data. The attack requires no JavaScript execution on the victim's machine and bypasses CSRF protection because the click genuinely originates from the victim's browser with their active session. The only reliable defense is preventing the skill UI from being loaded inside an iframe at all.
SA-SKL-CLICKJACK in scope: CLICKJACK-001 (no X-Frame-Options or frame-ancestors header), CLICKJACK-002 (deprecated ALLOW-FROM), CLICKJACK-003 (frame-ancestors 'self' allows subdomain embedding), CLICKJACK-004 (high-value confirmation dialogs without framebusting). All four are detected by SkillAudit's HTTP response header analysis and route-level CSP inspection.
CLICKJACK-001 — No framing protection headers
The most common clickjacking gap is a skill with no framing protection headers at all. Without X-Frame-Options: DENY or a Content-Security-Policy: frame-ancestors 'none' header, any website can embed the skill's UI in an iframe. The correct fix for most MCP skills is to deny framing entirely — there is no legitimate reason for a third party to embed an audit report or skill management UI in an iframe.
// VULNERABLE: Express middleware with no framing protection app.use(express.json()); // No helmet() or manual X-Frame-Options / CSP header set // Any page can embed this skill's UI in an invisible iframe
// FIXED: helmet() sets X-Frame-Options: SAMEORIGIN and CSP frame-ancestors
const helmet = require('helmet');
app.use(helmet({
frameguard: { action: 'deny' }, // X-Frame-Options: DENY
contentSecurityPolicy: {
directives: {
frameAncestors: ["'none'"], // CSP: frame-ancestors 'none'
// ... other CSP directives
},
},
}));
// Or manually without helmet:
app.use((req, res, next) => {
res.setHeader('X-Frame-Options', 'DENY');
res.setHeader('Content-Security-Policy', "frame-ancestors 'none'");
next();
});
X-Frame-Options or Content-Security-Policy: frame-ancestors header; any website can embed the skill UI in a transparent iframe enabling clickjacking attacks against install, consent, and account management flows. Fix: X-Frame-Options: DENY + Content-Security-Policy: frame-ancestors 'none' via helmet() or manual middleware; set both headers since CSP frame-ancestors is not supported in some older browsers and XFO is ignored in some newer ones.CLICKJACK-002 — X-Frame-Options ALLOW-FROM deprecated
X-Frame-Options: ALLOW-FROM https://trusted.example.com was designed to allow framing from a specific origin while blocking all others. However, ALLOW-FROM was never supported in Chrome and was removed from Firefox 70 (2019) and Safari. In modern browsers it is treated as an unrecognized directive and ignored — meaning the page can be framed from any origin. Skills that use ALLOW-FROM in the belief that they are restricting framing to a trusted partner domain actually have no framing protection at all in the browsers their users are most likely running.
// VULNERABLE: ALLOW-FROM is ignored in Chrome, Firefox 70+, Safari
res.setHeader('X-Frame-Options', 'ALLOW-FROM https://partner.example.com');
// Chrome: does not support ALLOW-FROM — ignores the header
// Firefox 70+: removed ALLOW-FROM support
// Result: page can be framed from any origin in modern browsers
// FIXED: use CSP frame-ancestors for selective framing (supported by all modern browsers)
// frame-ancestors is NOT ignored — it replaces XFO for selective allowlisting
// If only own domain should frame:
res.setHeader('Content-Security-Policy', "frame-ancestors 'self'");
// If a specific partner should frame:
res.setHeader('Content-Security-Policy', "frame-ancestors 'self' https://partner.example.com");
// Also set XFO for older browsers that don't support CSP:
res.setHeader('X-Frame-Options', 'SAMEORIGIN');
// (XFO SAMEORIGIN is widely supported as fallback)
X-Frame-Options: ALLOW-FROM <origin>; ALLOW-FROM is not supported in Chrome and was removed from Firefox 70+ and Safari, so this directive is silently ignored in all modern browsers — the page has no framing protection despite the developer's intent. Fix: replace ALLOW-FROM with Content-Security-Policy: frame-ancestors 'self' or frame-ancestors 'none'; keep X-Frame-Options: SAMEORIGIN as a fallback for older browsers.CLICKJACK-003 — frame-ancestors 'self' allows subdomain embedding
Content-Security-Policy: frame-ancestors 'self' restricts framing to same-origin pages — pages with the exact same scheme, host, and port as the resource. It does not restrict framing from other subdomains on the same registrable domain. If a MCP skill at app.skillaudit.dev sets frame-ancestors 'self' and an attacker gains control of staging.skillaudit.dev via a subdomain takeover vulnerability, the attacker can embed app.skillaudit.dev in an iframe from staging.skillaudit.dev — the frame-ancestors check passes because the framing page is under the same registrable domain and 'self' in CSP refers to the exact origin, but many developers believe it blocks all external sources including subdomains. The correct fix for skills that require no legitimate third-party embedding is frame-ancestors 'none'.
// POTENTIALLY INSUFFICIENT: frame-ancestors 'self' doesn't block subdomains
res.setHeader('Content-Security-Policy', "frame-ancestors 'self'");
// 'self' = exact origin: https://app.skillaudit.dev
// Does NOT block: https://staging.skillaudit.dev (different subdomain — different origin)
// If attacker controls staging.skillaudit.dev (subdomain takeover),
// they can iframe app.skillaudit.dev from that domain
// FIXED: frame-ancestors 'none' — no framing from any origin
res.setHeader('Content-Security-Policy', "frame-ancestors 'none'");
res.setHeader('X-Frame-Options', 'DENY'); // Belt-and-suspenders for older browsers
// If the skill genuinely needs to be iframed by its own marketing site:
// Use an explicit origin instead of 'self':
// frame-ancestors https://skillaudit.dev (only the exact origin, no wildcards)
Content-Security-Policy: frame-ancestors 'self'; this restricts framing to the exact same origin but does not block other subdomains of the same registrable domain — if an attacker gains a subdomain via subdomain takeover (see SA-SKL-SUBDOM), they can embed the skill UI cross-subdomain within a page that passes the 'self' check. Fix: use frame-ancestors 'none' unless there is a specific legitimate framing use case that requires 'self'.CLICKJACK-004 — Frameable confirmation dialogs without framebusting
Even when the main skill application has framing protection, individual high-value pages that perform irreversible actions — OAuth grant pages, skill installation confirmation dialogs, account deletion confirmations — may be missing the headers at the route level. Express middleware that sets security headers globally may be bypassed by route-specific middleware ordering, or some confirmation pages may be served from a different path that is excluded from the global security middleware. The defense requires both global framing protection and route-level framebusting JavaScript on the highest-value confirmation pages as defense-in-depth.
// VULNERABLE: security middleware applied after route handler registration
const app = express();
// Route registered BEFORE security middleware — doesn't get headers
app.get('/oauth/authorize', (req, res) => {
res.render('oauth-grant', { client, user }); // ← No framing protection
});
app.use(helmet({ frameguard: { action: 'deny' } })); // ← Too late
// FIXED: security middleware registered BEFORE all routes
const app = express();
// Register global security middleware first
app.use(helmet({
frameguard: { action: 'deny' },
contentSecurityPolicy: { directives: { frameAncestors: ["'none'"] } },
}));
// Then routes
app.get('/oauth/authorize', (req, res) => {
res.render('oauth-grant', { client, user });
});
// Defense-in-depth: framebusting script on high-value confirmation pages
// (catches cases where HTTP headers are stripped by proxies)
// In oauth-grant.html template:
// <script>if (window !== window.top) window.top.location = window.location;</script>
helmet() before all route definitions; add framebusting script (if (window !== window.top) window.top.location = window.location) to OAuth grant, install confirmation, and deletion confirmation templates as defense-in-depth.SkillAudit detection summary — SA-SKL-CLICKJACK
| Pattern ID | Severity | What SkillAudit flags | Fix |
|---|---|---|---|
| CLICKJACK-001 | HIGH | HTTP responses with no X-Frame-Options and no Content-Security-Policy: frame-ancestors | X-Frame-Options: DENY + frame-ancestors 'none' via helmet() |
| CLICKJACK-002 | HIGH | X-Frame-Options: ALLOW-FROM value present — deprecated in all modern browsers | Replace with CSP frame-ancestors 'self' + X-Frame-Options: SAMEORIGIN fallback |
| CLICKJACK-003 | MEDIUM | frame-ancestors 'self' without X-Frame-Options: DENY on skills with multi-subdomain deployments | Upgrade to frame-ancestors 'none' unless specific legitimate framing use case |
| CLICKJACK-004 | HIGH | OAuth/authorize, /install, /confirm, /delete routes missing framing headers (middleware ordering gap) | Register helmet() before all routes; add framebusting script to confirmation page templates |
Related patterns: For subdomain takeover vulnerabilities that enable the CLICKJACK-003 bypass, see SA-SKL-SUBDOM. For CSRF protection gaps on OAuth callback and confirmation endpoints, see SA-SKL-CSRF. For Content-Security-Policy bypass patterns, see SA-SKL-CSPVIO.