FDE Times dataFDE jobs open 924▲33 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 80Companies hiring 196Remote-friendly 25%Median US pay $200kTop hirer Databricks 107
中文VI

The newspaper of the Forward Deployed Engineer

Books & courses

The API flaw an FDE should find before the client's security team

Corey Ball's Hacking APIs teaches you to probe an API's weakest point, where a request stealing data looks just like a legitimate one.

Cover of Hacking APIs: Breaking Web Application Programming Interfaces
Hacking APIs: Breaking Web Application Programming Interfaces · Corey J. Ball · Cover: Open Library
ShareLinkedInFacebookX

In brief

  • Hacking APIs by Corey J. Ball (No Starch Press, 2022) is a crash course in security testing REST and GraphQL APIs.
  • According to Ball, authorization is the number one weakness because a request for someone else's resource looks almost identical to a valid one.
  • For FDEs, the book's value lies in the habit of attacking their own integrations before go-live.
Two requests side by side. On the left, a valid request: GET /api/orders/1042. On the right, the ID is changed to 1043, an order belonging to client B. Both carry a valid token and correct format, and both receive a 200 with data. The only difference is the ID, highlighted in orange.
Hypothetical example: with client A's token, changing only the order ID still returns a 200 with data. Corey Ball puts this authorization flaw at the top of his list. Source: Corey Ball, interview with F5; illustrative example by FDE Times.

“The biggest problem with APIs is authorization.” Corey Ball, author of Hacking APIs, said it on Synack’s podcast. Anyone who has held a token and wired their own system into a client’s internal API will know he is not exaggerating.

You read the spec, write the integration, open new webhooks and call endpoints few others have ever called. If there is a hole, there is a good chance you will walk past it before the security team does. This book teaches you to recognize it when you do.

A crash course from a working pentester

The full title is Hacking APIs: Breaking Web Application Programming Interfaces, by Corey J. Ball, published by No Starch Press on July 12, 2022. In early 2021, when he spoke to PortSwigger, Ball was a Cybersecurity Consulting Manager and was writing the book for No Starch.

The publisher calls it a crash course in web API security testing. By its account, readers come away able to pentest APIs, hunt for rewards in bug bounty programs and make their own APIs more secure.

Ball sums it up as taking readers from zero to proficient: foundations first, then the vulnerabilities.

The material covers both REST and GraphQL, along with tools such as Burp Suite, Postman, Kiterunner and OWASP Amass. Every FDE already uses Postman. The rest is the attacker’s toolkit.

Why FDEs should learn to think like attackers

Ball argues that APIs are an enormous attack surface for most organizations, and that internet-facing APIs are often the way in for an intrusion. Every FDE deployment opens a few more of those doors. His core advice is blunt: if you do not test them yourself, sooner or later a cybercriminal will do it for you.

This is not a reason for FDEs to become pentesters. The goal is to arrive at the review with the client’s security team having already answered the questions they are about to ask. An FDE who can do that earns trust much faster, and trust decides whether a deployment reaches production.

Lesson one: test authorization first

In an interview with F5, Ball explained why this flaw is so hard to catch: an attacker’s request for someone else’s resource looks very much like a legitimate request. The token is valid, the format is valid; only the ID belongs to someone else.

Take a hypothetical case. Your integration calls GET /api/orders/1042 with customer A’s token. You change it to 1043, an order belonging to customer B. If the API returns 200 with data, you have just found the class of flaw Ball puts at the top of his list, and logs or firewalls will struggle to tell it apart from normal traffic.

What to do at the client right away: ask for two test accounts with different permissions or in different tenants, then swap IDs between them on every endpoint your integration touches. Do it before go-live, not after.

Lesson two: a scanner is only a starting point

Ball says vulnerability scanning is a good start but not enough. He wants testers to think like an adversary, through pentesting for example, to find business logic flaws: the kind automated tools cannot grasp because they do not know what the business process looks like.

FDEs do know that process, having spent a week in customer discovery. You know which step must come before which, and who is allowed to approve what. So ask yourself: if you call a later step and skip the one before it, does the API stop you?

Lesson three: know every door before you lock them

A large attack surface is only dangerous when nobody knows what it contains. The book makes room for discovery tools such as OWASP Amass and Kiterunner, because attackers start with discovery too. Better to draw up your own list of endpoints before an attacker does.

Who should read it, and in what order

The book suits people who already write integrations every day, use Postman fluently and understand how tokens, sessions and roles work. If HTTP, authentication or REST structure still trip you up, do not skip the foundations Ball puts at the start of the book: every technique that follows depends on them.

Leave GraphQL for last if your clients do not use it yet. When you land a client that does, go back to that section before the first week of the engagement.

For your career, this skill is easy to prove. On a CV, instead of a vague “interested in security,” state specifically that you reviewed authorization on an integration’s endpoints before go-live, and what you found and reported.

When reading FDE job ads, lines that mention security reviews or working with the client’s security team are where to bring out this example.

The client’s security team will get round to probing their APIs eventually. The question is whether you want to be the one who finds the hole first, in the integration you wrote yourself.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
7 sources
Read next on the roadmap · Stage 2: Broad engineeringWhen Streamlit falls short for clients, this free React course helpsLearn React offers more than 600 sandboxes that run in the browser, but engineers who know only Python should learn JavaScript first.