Ansar Shaikh

An API test suite should fail on the vulnerable build

· api-qa-suite on GitHub

A lot of API test suites check the happy path and a few 4xx codes. They miss the bugs that matter: reading someone else's object by changing an ID, forged tokens, leaked password hashes, mass assignment, missing rate limits. How do you know your suite would catch those? I built it against an API with the bugs planted in it.

Setup

api/app.py is a small Tasks API. With APP_MODE=vulnerable it ships 6 seeded defects that mirror OWASP API Security Top 10 findings; APP_MODE=fixed corrects them. The suite has three layers:

CI runs a matrix: the fixed build must pass, and the vulnerable build must fail exactly the 9 security tests.

Results

The vulnerable-mode check is the part I'd keep in any project. A green suite only tells you something if you've seen it go red for the right reasons.

← All posts