Day 6: CSS Injection + Clickjacking to Account Takeover
A CSS injection flaw in custom community themes allowed an attacker to inject arbitrary CSS, which was combined with clickjacking to trick a victim into submitting an email change form. The attacker could then change the victim's email to their own, reset the password, and take over the account.
Published on medium.com
In today’s challenge, I’ll break down an interesting account takeover chain where CSS Injection and Clickjacking were combined to trick victims into changing their email, ultimately leading to full account takeover.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application failed to properly escape user-supplied input in the custom theme's font settings, allowing CSS injection, and the email change form lacked proper CSRF protection or clickjacking defences.
Impact
An attacker could change a victim's email address and then reset the password to achieve full account takeover.
What the attacker needed
Attacker can create a custom community; victim visits attacker-controlled page; victim clicks a button
The fix
The application should properly escape user input in CSS contexts and implement CSRF tokens and clickjacking protections on sensitive forms.
How it was found
- Create a custom community and set a font value that breaks out of the CSS context.
- Inject CSS to hide everything on the account settings page except the submit button.
- Use CSS to change the button text to something enticing.
- Trick the victim into visiting the page and clicking the button, which submits the email change form.
- The victim's email is changed to the attacker's email, allowing password reset and account takeover.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
CSS injection lets an attacker add their own styling rules to a website, which can hide or alter parts of the page. Clickjacking tricks a user into clicking something they didn't intend to, like a hidden button. Together, these let the attacker make a victim unknowingly change their account email, which then allows the attacker to reset the password and take over the account.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.