Skip to content
Access control Write-up Beginner

How a Routine Security Test Led to My First CVE and Bug Bounty: Lessons in API Security and Beyond

Admin-only API endpoints in a third-party low-code tool accepted a lower-privileged user's token and returned the same data, so a regular user could reach admin functionality. The response also leaked a database username and password.

tech.cashfree.com

Published on tech.cashfree.com

Every security engineer has that one story — an unexpected discoverythat changes the course of their career. For me, that moment came when I stumbled upon a serious vulnerability in a tool we were using.

Anubhav Sharma, on tech.cashfree.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 checked that a request carried a valid token but did not check that the token's role was allowed to call that endpoint, and the endpoint returned far more data than needed.

Impact

A regular user could call admin APIs and read data meant for administrators, including database credentials, which could lead to wider compromise of the data behind the tool.

What the attacker needed

Accounts in at least two roles; a proxy tool to capture requests; the third-party tool in use

The fix

The vendor released a security advisory and fix for the tool; the author's advice is to test third-party tools yourself and never return sensitive data such as database credentials in API responses.

How it was found

  1. Log in as the admin and capture the admin API calls with a proxy tool.
  2. Note the call that fetches access resources for the user.
  3. Log out and log back in as the requester role.
  4. Take the captured admin request, swap the admin token for the requester's token and send it.
  5. Observe that the response is identical and contains a database username and password.

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.

The application had different roles, such as admin and requester, and the server was supposed to check which role was asking. It did not: when a normal user's login token was sent to an admin-only address, the server answered as if an admin had asked, and the answer even contained a database username and password.

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.