PATCH//NOTES Open it in the app
← All hands-on practice
Web security · 12 min

Talk to the API: JSON and two classic flaws

Apps talk to servers through APIs: a request goes out, JSON comes back. Use Wrenfield & Co's shop API as a customer, then find two things it forgot to check, and fix them.

Start it: free, in your browser, no account

What you will do

  1. Ask the API for your own profile.
  2. Open one of your own orders.
  3. Send a PATCH with a mistake in its JSON, and read the error.
  4. Your orders are 5001 and 5003. Try the one in between.
  5. Make yourself an admin, then list every user.
  6. Turn both fixes on, then send both attacks again and watch them fail.

Exam objectives it practises

  • CompTIA Security+ 2.3 Types of vulnerabilities
  • CompTIA PenTest+ 4.5 Web application attacks

Simplified: a handful of endpoints answered inside the page, with no real network. The token is a JWT with a made-up signature, and the server takes your role from its own database, not from the token. Real APIs also rate-limit, log and send more headers, and error wording varies. These two flaws are API1 and API3 in the OWASP API Security Top 10 (2023). Only test APIs you are authorised to.