← Clickjacking lesson
Web InfrastructureClickjackingIntermediate40 min+150 XP

Invite a New Admin

The People Admin renders a privileged action without X-Frame-Options or CSP frame-ancestors. Embed it on the attacker origin, disguise the click, and make the victim bot submit the action.

“The user clicked a prize button. The browser clicked an admin action.”

CWE-1021OWASP Top 10 A05:2021OWASP ASVS 14.4.3
The story
A frame turns someone else's UI into your attack surface. Ask whether a sensitive action can be embedded and disguised, and whether the server forbids framing.

HTML frames allow one origin to render another origin's page. Without X-Frame-Options or CSP frame-ancestors, an attacker can overlay a transparent iframe and route a real click into a privileged control.

Your objective
  • Inspect the framing protections
  • Build an iframe overlay on the attacker origin
  • Report the attacker URL to the bot
  • Capture the flag
Boundary under test

Target page to framing origin

Field guide · request anatomy

Where to look before you type a payload

01Frame

The attacker page loads the target in an iframe; the browser asks whether framing is allowed.

02Disguise

The attacker overlays transparent or misleading content so the visible control differs from the target control.

03Click

The victim clicks the attacker's page; the browser routes the click to the framed target.

04Action

The target performs the privileged action with the victim's session.

Progressive hints

Open one hint at a time. The first two build the model; the last two point at the boundary.

Hint 1

Find the administrative action that completes in one click.

Hint 2

Check whether the response permits framing.

Hint 3

No frame protection is present. Report http://attacker.lab.localhost:3001/attack?target=/admin/invite; the bot clicks the invisible admin control.

Hint 4 · near the answer

Report the attacker URL; the bot clicks the disguised control.

Guided workbench

Observe → Hypothesize → Test → Prove → Explain

This is the same loop a reviewer expects in a report. Your draft stays in this browser; nothing is submitted until you choose to export it.

0/15steps complete
Observe0/3
Hypothesize0/3
Test0/3
Prove0/3
Explain0/3

Evidence log

Write for a reviewer who was not in the room. Every claim needs a request, response or state change behind it.

Preview the evidence report
# Lab evidence report — Invite a New Admin

- Family: Clickjacking
- Lab ID: web-clickjacking-invite
- Date: 2026-12-05

## Workflow

### Observe

- [ ] Open "Invite a New Admin" and record /admin/invite, the HTTP method and the role you are given.
- [ ] List every parameter, header, cookie and object identifier the normal flow exposes.
- [ ] Save a baseline response: status, body shape, timing and the fields that change by user.

### Hypothesize

- [ ] Name the server decision that protects /admin/invite, and the evidence it should use.
- [ ] Use the clue as a constraint, not an answer: Report http://attacker.lab.localhost:3001/attack?target=/admin/invite to the bot. The iframe loads the admin page and the bot clicks the disguised control.
- [ ] Predict the exact status, body or state change that would prove the decision is missing.

### Test

- [ ] Start from the baseline and change one value: the /admin/invite frame.
- [ ] Keep the request replayable; vary encoding, method or identifier location only after the first result.
- [ ] Capture the full request and response for the winning attempt, including the flag.

### Prove

- [ ] Capture the flag and name the exact foreign object, role or state change it proves.
- [ ] Repeat from a clean session and confirm the result is not cached or stale.
- [ ] State impact precisely: what data or action did you actually obtain?

### Explain

- [ ] State the root cause without naming the payload: which decision failed?
- [ ] Name the control that prevents recurrence and the layer where it belongs.
- [ ] Write one regression test that fails before the fix and passes after it.

## Evidence

### Target and baseline

_Not recorded._

### Hypothesis

_Not recorded._

### Winning request

_Not recorded._

### Proof

_Not recorded._

### Root cause

_Not recorded._

### Control and regression test

_Not recorded._

## Analyst conclusion

The proof demonstrates the missing control above. The regression test should fail against the vulnerable behavior and pass after remediation.
Solution and debrief
Locked until you capture the flag.

The full request, the reasoning and the debrief unlock after a successful capture. That is deliberate: struggle first, then consolidate.

What a reviewer will ask

False positives to rule out

  • The page sets X-Frame-Options: SAMEORIGIN and the attacker is on a different origin: framing is blocked, so the basic attack fails.
  • A frame-buster script exists: test whether it runs before the click and whether it can be bypassed.
  • The iframe loads but the action needs a typed confirmation: a blind click is not enough.

Regression tests to name

  • Frame blocked: The browser refuses to render the frame
  • CSP directive: frame-ancestors 'none' is present, not only default-src
  • Legacy header: DENY prevents framing
The defender's move
  • Send Content-Security-Policy: frame-ancestors 'none' on sensitive pages.
  • Keep X-Frame-Options: DENY for legacy browsers.
  • Require confirmation or re-authentication for high-impact actions.
  • Design sensitive controls so a single blind click cannot complete them.
See the secure-code pattern and all 4 regression tests →
الخلاصة

Clickjacking تستغل إطارًا شفافًا ليحوّل نقرة المستخدم إلى إجراء إداري. الحل هو منع التأطير عبر CSP frame-ancestors وX-Frame-Options، مع تأكيد إضافي للإجراءات الحساسة.