Skip to content
CSRF Write-up Beginner

Gradle Plugin Portal: Clickjacking & Cross-Site Request Forgery enabling Account Takeover

The Gradle Plugin Portal's profile page lacked an anti-framing header and its account update form had no anti-CSRF token, so any website could submit a forged form using the visitor's session and change a logged-in plugin author's username, email and password. Because the session cookie never expired, an attacker could take over accounts of plugin authors and potentially publish malicious plugins.

medium.com

Published on medium.com

I’ve recently acquired an interest in Software Security Capture the Flag (CTF) challenges. While perusing YouTube I stumbled across this Mr.

Jonathan Leitschuh, on medium.com

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

The account update form relied only on the session cookie for authentication and had no anti-CSRF token, and the site sent no X-Frame-Options header to prevent framing.

Impact

Any website could have changed the credentials of a logged-in plugin author, and because the session never expired this could lead to account takeover and potentially malicious plugin releases; the clickjacking variant required the victim to be logged in or to be tricked into logging in.

What the attacker needed

Victim logged in to Plugin Portal; victim visits attacker page; session cookie does not expire

The fix

The site was fixed by adding an X-Frame-Options header and a hidden CSRF token that the server validates on form submission.

How it was found

  1. Open the Plugin Portal user management page and inspect the profile update form in the browser developer tools.
  2. Note that the form posts to the user page and carries no authentication token.
  3. Copy the form element into a separate HTML document and remove the styling.
  4. Open that document locally, enter a new username and password, and submit the form.
  5. Log out and confirm the new password works on the Plugin Portal account.

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.

When you log in to a site, your browser keeps a session cookie that proves who you are, and it sends that cookie with every request to the site, even requests triggered by a different website. If the site's forms do not carry a secret token that only the real site can produce, another site can quietly submit the same form on your behalf. Separately, if a site can be loaded inside a frame on someone else's page, an attacker can overlay invisible buttons so your clicks land on the real site.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.