API testing · Errors
Error response leaks the database host, user and file paths
P2 · MajorIntermediateErrors
Want to find it yourself first? This page gives away the answer. Play this bug on a fake app screen and see if you can spot it in three tries.
The clue
What does this error tell an attacker?
Steps to reproduce
- Send GET /api/orders/abc (a text id instead of a number)
- Read the error body
Expected result
400 Bad Request with a short message and no internal details
Actual result
A 500 with a trace naming db-prod-2.internal, user=admin and /srv/app/orders.js
Why it matters
This is a major (P2) bug. The feature still works in part, but users get wrong information or a broken step, and many will notice. It should be fixed before or soon after release.
Testing tip
Send bad input on purpose. Errors should be short and safe; details belong in server logs, not responses.
How to find bugs like this
API bugs live in the JSON between the app and the server: wrong records returned, fields that leak private data, bad status codes and limits that are not enforced. When you test, try these checks:
- Read the whole response body, not only the status code.
- Ask for other users’ records on purpose.
- Look for fields that should never leave the server.
- Send values at and past every limit.