What to do when you find a critical API bug
On finding a critical API bug, the first rule is not to exploit it further: work with test accounts and do not enumerate other people's data. Then reproduce it with a minimal request, collect evidence without secrets, rate severity by impact, likelihood and difficulty of exploitation, and report through a security channel rather than a public ticket. After the fix, add a regression test to CI.
API · Typical bugs
You found that someone else’s invoice opens by id. What do you do in the first hour?
A critical API bug is a leak of other people’s data, money, privilege escalation or an unavailable service. You can go wrong not only in the bug itself but in the reaction: keep exploiting the vulnerability “to investigate”, lose the evidence, or write about it in a public ticket. A good reaction achieves one thing: the developer reproduces the bug on the first attempt and understands how serious it is.
The lesson gives a ten-step order, explains why it is this way and shows a report that can be handed over without any follow-up questions.
How it works
The order is built around two risks. The first: harm from the investigation itself, hence “do not dig deeper” at the start. The second: losing evidence and time, hence reproduction, evidence and severity come before the ticket, not after. Each step answers one question that a developer or the security team will ask:
- Do not dig deeper. Do not exploit the bug, do not enumerate other people’s data, do not perform destructive actions. Work on test accounts and test data;
- Reproduce minimally. The smallest set of steps, one request if possible (curl). Repeat 2-3 times. For races record the frequency (for example 7 of 10);
- Isolate the layer. The same request without the UI, without the gateway or cache, by another user, on another environment. Find out when it appeared: the last release or long ago;
- Collect evidence. The full request and response (no secrets in the clear), status, headers, a request or trace id, timestamps with a zone, version and environment, resource ids, a log fragment;
- Estimate the scale without harm. Which methods, roles and resources are involved, one record or a whole class. Do not bulk-collect real data;
- Severity. Impact × likelihood × difficulty of exploitation. A data leak, money or privilege escalation is critical. Report it immediately through the security channel or the on-call person, not in a public ticket;
- The report in the template below;
- A temporary mitigation. Suggest a workaround (disable the endpoint, a feature flag, a gateway rule). The team decides;
- Verify the fix. The same case, neighbouring resources and methods, negative variants, on the environment where it was found and after the release in production;
- Regression. An autotest in CI, a schema check, an item in the checklist. Ask why the bug was missed.
The reaction to a found leak
“I will see what else is there”
Enumerating other people’s ids, screenshots with real data in a chat, a public ticket. The harm grew, and there is no evidence in usable form.
A minimal reproduction and the security channel
Two own accounts, one request, evidence without secrets, a message to the responsible people. The harm did not grow, the actions are clear.
Example: from the finding to the report
Step 2 looks best as a single request that the developer can run themselves. Secrets are substituted via variables, and a request id helps find the trace in the logs:
# one request, two own accounts, nothing else
curl -i "$BASE/v1/invoices/10442" \
-H "Authorization: Bearer $TOKEN_QA_A" \
-H "X-Request-Id: bug-bola-001"
Next is isolation: the same request straight to the API (without the app), with another role, on another environment, and finding out since when the bug exists (from the release history). The report is assembled from the facts found. It must be complete without any follow-up questions:
Title: [Critical][API] GET /invoices/{id} returns another user's invoice (BOLA)
Environment: stage, build 2026.11.3, 2026-11-09 14:12 (UTC+2)
Steps:
1) Sign in as qa-a (id 77), get a token
2) GET /api/v1/invoices/10442 (invoice of qa-b, id 91) with qa-a's token
Expected: 403 or 404
Actual: 200, ownerId 91, the full invoice
Evidence: X-Request-Id 7f3a..., response attached (tokens redacted)
Impact: any user can read others' invoices; ids are sequential
Checked: PUT and DELETE on 10442 also work; /invoices/{id}/pdf too
Workaround: none; suggest closing /invoices/{id} at the gateway for now
Notes: reproduces 3 of 3; first build with the bug is 2026.11.1
Why it is like this. A title with the severity and the place gives triage in a second. “Expected” and “Actual” separate a bug from an opinion. The “Checked” block shows the scale without requiring enumeration of other people’s data. Evidence with redacted tokens (Bearer … cut off) does not create a new leak from the ticket itself.
Two starting severity levels
Critical
A leak of other people’s data, money, privilege escalation, full unavailability. Immediately, through a separate channel, with a suggested workaround.
High and below
Limited impact or difficult exploitation. A regular ticket, but with the same set of evidence.
Limits and alternatives
- The order does not replace company policy. There are incident response processes, a channel for vulnerabilities and, in open projects,
SECURITY.mdor a bug bounty programme. Find them first. - In regulated fields (payments, healthcare) a leak has legal notification deadlines. The product owner or security does that, but the tester has to give them the facts quickly.
- A temporary mitigation is not a fix. A workaround on the gateway closes the known path, not the cause, so the ticket stays open until the code is fixed.
- Sometimes a minimal reproduction is impossible: the bug depends on data or a race. Then collect the frequency, conditions and logs, and do not invent deterministic steps.
Common mistakes
- Investigating “a little more” on other people’s data. That is already access to data nobody allowed, even with good intentions.
- Attaching a token or password in the clear. A ticket with a secret becomes a leak itself.
- Writing severity “high” without explaining the impact. Without “who loses what”, triage guesses.
- Opening a public ticket for a vulnerability. First the security channel or a responsible person, the ticket after a decision.
- Closing the bug after the release without a regression test. Without an autotest it comes back.
Check yourself
You found BOLA and want to estimate the scale. How many other people’s ids may you enumerate as proof?
Answer
None. Two of your own accounts are enough as proof: A’s token reads B’s resource. I estimate the scale by methods, addresses and roles, not by the number of real records. There is no need to collect what you see in other people’s data, the fact that access exists is enough.
A developer says “It does not reproduce”. What was wrong with the report and what do you add?
Answer
The environment and build, the exact request, resource ids, time with a zone and a request id were missing. I add a single curl request with my two accounts, expected and actual results, the frequency (“3 of 3”) and the version where the bug appeared. If the bug depends on data or a race, I add the conditions and logs.