Skip to content
Access control Write-up Intermediate

Admin Portal Hijacking — Bug Bounty Writeup

The admin portal returned the full HTML content of protected pages inside redirect responses to the login page, and the login check was performed only on the client side. An attacker could therefore view admin pages and use admin functionality without any credentials.

the7th Follow

Published on the7th.medium.com

Today, I wanted to write about a bug-hunting story where I was able to take over an admin portal without any username or password. It was a VDP target, but the details may be useful for you.

Mostafa Alrefai, on the7th.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 included protected page content in redirect responses and relied on client-side JavaScript for the authentication check.

Impact

An unauthenticated attacker could view admin information and use all admin functionality.

What the attacker needed

Ability to intercept and modify responses

How it was found

  1. Request an admin portal page such as /admin and observe that the response is a redirect to the login page but contains the admin page HTML in its body.
  2. Use a proxy rule to change the redirect status code to 200 OK so the browser renders the body.
  3. Notice that the page still hides data because a client-side login check fails.
  4. Use a second proxy rule to change the response so the client-side login flag is true.
  5. Access any admin page, view admin information, and use admin functionality.

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 visit a protected page without logging in, the server should send you to the login page and not include the protected page's content. Here the server sent the login redirect but also included the hidden admin page content in the same response. The site also decided whether you were logged in using code running in your browser, which a user can change, so the attacker could make the browser show the admin pages.

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.

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.