Skip to content
Access control Write-up Beginner

How I got full admin control on a government website

A profile update request accepted extra fields the client never intended to send, and setting one of them to true granted the account superuser rights. An attacker could register, tamper with the request, and gain full admin access to the site.

jsamia Follow

Published on medium.com

Been a very long time since I’ve done a writeup here so I’ll try to go into more detail about the process I had and the vulnerability.

Jaeden Samia, 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

Likely the server bound all submitted fields to the user record without restricting which fields a normal user may change, allowing privilege fields to be set.

Impact

The attacker gained full admin access, could see other admins, make site changes and view every user and staff detail; the text notes only one of three account types allowed the change.

What the attacker needed

A free account; ability to intercept requests; one specific account type

The fix

The issue was fixed within a week after the report.

How it was found

  1. Enumerate subdomains and find a site that allows user registration.
  2. Register an account and go to the profile edit page.
  3. Intercept the name-change request and note extra fields such as is_staff.
  4. Change the superuser field from false to true and forward the request.
  5. Submit another name change to confirm which field stuck.
  6. Return to the homepage and observe full admin access.

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 edit your profile, your browser sends a request to the server with your new details. The server here trusted extra fields in that request that the normal page never sends, so a user could add a hidden 'make me an admin' flag. The server accepted it, and the account became an administrator.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by jsamia

View all

4 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.