Skip to content
Access control Write-up Intermediate

$5,000 | Authorization Bypass via Parameter Parsing Mismatch (Dj

The Django frontend checked the user_id query parameter for ownership, but the Flask backend read user_id from the JSON body because it used force=True, so an attacker could supply a different user_id in the body and read another user's data.

Priyanshu Shakya Follow

Published on medium.com

A critical authorization bypass was discovered due to inconsistent parameter parsing between the Django frontend API and the Flask internal API. This allowed an attacker to access other users’ data by manipulating the request body, while bypassing Django’s user ownership check.

priyanshu shakya, 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 two services parsed the same parameter from different places (query string versus JSON body), so the authorisation check and the data lookup used different values.

Impact

An attacker could read any other user's data, a horizontal privilege escalation.

What the attacker needed

A valid account; knowledge of another user's id

The fix

The backend should not force-parse the body on GET requests and both services should agree on where the parameter is read and validated.

How it was found

  1. Send a GET request to the /user endpoint with your own user_id in the query string.
  2. Include a JSON body with a different user_id and set the Content-Type header to application/json.
  3. Observe that the response contains the other user's private data.

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.

A website has two parts: a front door (Django) that checks who you are, and a back room (Flask) that fetches data. The front door checked one copy of your user number, but the back room read a different copy from the request body, so you could show the front door your own number and the back room someone else's.

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.