Skip to content
Sharan L · QA Engineering
Menu

← All case studies

API & Integration Reliability Audit · Security basics · SQL checks

Online shop API: a customer-data leak and pricing bugs caught before launch

API and database tests on a demo shop found 10 defects, including any customer being able to read another customer's orders. All 10 fixes verified, and the checks run on every change.

Demonstration on synthetic data in my own demo project, not client work.

Scenario

A small online shop (ShopLab, built for this demonstration) is about to launch: sign-up, login, cart, discount codes and checkout, served by a REST API with a SQLite database. Before customers arrive, the team wants to know whether the API is safe to put in front of them.

Risks

Tests

Defects found

IDDefectType
D06Any customer can read another customer's orderCritical
D01Account never locks after repeated wrong passwordsHigh
D03One discount code can be applied twiceHigh
D05Quantity accepts 0 and negative numbersHigh
D08Stock goes negative under simultaneous ordersHigh
D02Sign-up accepts "a@b" and 1-character passwordsMedium
D04Tax truncated instead of roundedMedium
D07Malformed input returns a 500 with a stack traceMedium
D09Listed price differs from the databaseMedium
D13Security headers missingLow

Evidence

Fix

Each defect fixed in v1.1 of the shop: the same code base, switched by one setting, so the fix and the defect can be compared side by side.

The whole suite rerun against v1.1, and a CI gate that fails if any defect stops being detected on v1.0 or anything fails on v1.1.

Result

v1.0 (seeded defects)
10 of 10 API defects detected
v1.1 (fixed)
58 of 58 tests pass
Regression safety
Both builds tested on every change

Lessons

  1. Authorization bugs need two real accounts: a suite that signs in as one user passes while any customer can read any order.
  2. Some defects only exist under concurrency. Overselling never shows up when orders are placed one at a time.
  3. Check the database, not only the API response: the price and stock mismatches were confirmed in SQL.

Need this for your product?

Get a suggested scope and starting price in four questions, or tell me about your project.

Scope BuilderGet a quote

Next case study: Release decision: from 14 defects to a clear Go/No-Go →