Skip to content
Access control Write-up Intermediate

Exploiting Access Control Misconfiguration: Privilege Escalation via Improper PATCH Method…

A website restricted most HTTP methods but left PATCH functional, letting a regular user modify any other user's data by knowing their ID. The author also found two more paths with the same flaw.

momenrezkk90 Follow

Published on medium.com

After 8+ hours of analyzing over 10 JavaScript files of a specific website, I successfully discovered a Path that allowed me to bypass Access Denied restrictions. By exploiting this, and as a regular user, I was able to modify any user’s data on the website just by knowing their ID. 🚀

MOAMEN REZK, 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 access-control check was applied to most HTTP methods but not to PATCH, so the update endpoint accepted PATCH requests without proper authorisation.

Impact

A regular user could modify any other user's data if they knew the victim's ID, and two additional paths had the same flaw.

What the attacker needed

A regular user account; know the victim's user ID

How it was found

  1. Analyse the website's JavaScript files to gather endpoint paths.
  2. Test the paths and observe that most HTTP methods return access denied.
  3. Try the PATCH method on a path and see that it bypasses the 403 page.
  4. Work out the correct request body format to send the data.
  5. As a regular user, modify another user's data using their ID.

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.

Websites often block certain types of requests to stop people changing data they should not. Here the block missed one request type, PATCH, which is normally used to update records. Because of that gap, a normal logged-in user could change other people's information if they knew the other person's ID number.

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 momenrezkk90

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.