Skip to content
Access control Write-up Beginner

Making 500 By Flipping A 0 To 1

A request parameter called ref_type controlled whether the user was treated as an admin, and changing its value from 0 to 1 granted admin-level access to that request. An attacker could then use the elevated permissions to delete almost all sessions.

Adam J Sturge Follow

Published on infosecwriteups.com

I recently found my first vulnerability in the wild. The vulnerability was a P1 and all I had to do was turn a 0 into a 1.

Adam J Sturge, on infosecwriteups.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 trusted a client-supplied parameter to decide the user's privilege level instead of checking the user's actual role on the server side.

Impact

An attacker could gain admin permissions on affected requests and could write a script to delete almost all sessions.

What the attacker needed

An account in the app; ability to intercept app traffic; Android emulator with Burp

The fix

The team fixed it immediately after the report, though the text does not describe the fix itself.

How it was found

  1. Set up Burp Suite to intercept HTTP traffic from an Android emulator.
  2. Use the app normally and review the HTTP history in Burp.
  3. Notice a request containing the parameter ref_type with value 0.
  4. Change the value from 0 to 1 and observe that the request now has admin-level 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.

An app sends requests to a server, and some requests include a value that tells the server what the user is allowed to do. Here, a value of 0 meant normal user and 1 meant admin, and the server trusted whatever the app sent. By changing that number, the person could act as an admin for that request.

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.