API Hacktics: Unveiling Vulnerabilities in Modern Web APIs
The API accepted a role field during profile updates, letting the author make their own account an administrator. It also lacked rate limiting on registration and fetched arbitrary URLs for avatars, exposing cloud instance metadata.
Published on myselfakash20.medium.com
It was a Saturday afternoon when I decided to delve back into bug hunting. This time, I wasn’t focusing on typical web applications or frontend exploits but instead setting my sights on something more elusive: APIs.
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 API bound incoming JSON directly to internal user objects without an allow-list, and the avatar fetcher did not restrict which hosts it could contact.
Impact
An attacker could become an administrator, create accounts in bulk for spam or denial of service, and read cloud instance metadata that could lead to deeper access.
What the attacker needed
An account on the fintech platform; ability to send crafted API requests
The fix
The text says the security team confirmed all three issues but does not describe the fixes applied.
How it was found
- Map API endpoints using browser developer tools and Postman.
- Fuzz for undocumented endpoints with FFUF.
- Send a profile update containing a role field set to admin.
- Observe the response confirming the role change.
- Send many registration requests in a loop to test rate limiting.
- Submit an avatar URL pointing at the cloud metadata address and read the response.
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 API is the part of a website that apps talk to behind the scenes. Here the profile-update API trusted a field called role that users should never be able to set, so the author could make themselves an admin. Separately, the avatar feature would fetch any web address the user supplied, including one that only the server can normally reach.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.