Frontend Labs
⋯

Chapter 40E — Implementing the OWASP API Security Top 10 (2023)

In one sentence

The OWASP API Security Top 10 is a checklist of the ten most common ways APIs actually fail in production, and this chapter walks all ten, maps each to the concrete control already built elsewhere in this guide, and fills in the three items — unrestricted business-flow access, inventory management, and unsafe consumption of third-party APIs — that get the least attention elsewhere.

Where we are

This is the synthesis chapter for Part 6A: pulling API payload security (Ch 40A), rate limiting (Ch 40B), WAF (Ch 40C), and WAAP (Ch 40D) together with the authorization material from Parts 5-6, mapped explicitly onto the industry- standard list, so you can walk into a design review and check off each item with a real, built control rather than a vague assurance.

How it works

The full list, each mapped to where the real control lives:

   API1:2023  BROKEN OBJECT LEVEL AUTHORIZATION (BOLA)
     an endpoint returns/modifies an object by ID without confirming the
     CALLER actually owns/may access that specific object.
     -> CONTROL: ownership in the query (G1 Ch 45), a ReBAC check per
        object (Part 5 Ch 25), RLS as the structural backstop (Part 5
        Ch 27). Still the #1 real-world API finding, by a wide margin.

   API2:2023  BROKEN AUTHENTICATION
     weak token validation, missing MFA on sensitive flows, predictable
     API keys, tokens that never expire.
     -> CONTROL: G1 Ch 46 (session/JWT hygiene, OAuth/OIDC done
        correctly), Part 6 Ch 39 (advanced OAuth/SAML attacks and their
        fixes).

   API3:2023  BROKEN OBJECT PROPERTY LEVEL AUTHORIZATION
     (merges the older "excessive data exposure" and "mass assignment"
     categories) -- an endpoint returns MORE fields than the caller
     should see, or accepts MORE fields than it should, on an object the
     caller IS otherwise allowed to touch.
     -> CONTROL: Ch 40A's `additionalProperties: false` + explicit
        response-shaping DTOs (return exactly the fields the caller is
        authorized to see, never "the whole model minus a blocklist").

   API4:2023  UNRESTRICTED RESOURCE CONSUMPTION
     no limits on request size, response size, pagination, execution
     time, or number of concurrent requests -- the API can be starved or
     made to do disproportionate work per request.
     -> CONTROL: Ch 40B (rate limiting, all dimensions), Part 5 Ch 28
        (timeouts, bulkheads, complexity limits), Ch 40A (payload
        size/depth limits).

   API5:2023  BROKEN FUNCTION LEVEL AUTHORIZATION (BFLA)
     an endpoint that performs a PRIVILEGED action is reachable by a
     caller who holds the right kind of token but the WRONG role/
     permission level -- distinct from API1 (which is about object
     OWNERSHIP, not function/role).
     -> CONTROL: G1 Ch 45 (role checks server-side on every request),
        Part 5 Ch 25 (a centralised policy engine so this isn't a
        scattered, inconsistent per-handler check).

   API6:2023  UNRESTRICTED ACCESS TO SENSITIVE BUSINESS FLOWS
     a flow that's technically authenticated and authorized but has NO
     limit on how many times a legitimate-looking caller can execute it
     -- enabling abuse that's a BUSINESS problem, not a technical
     vulnerability in the classic sense: TICKET-SCALPING BOTS buying up
     concert/event tickets faster than any human could, SNEAKER-BOT
     economies automating limited-release purchases, mass fake-account
     creation for promo-code abuse, automated gift-card-balance checking.
     -> CONTROL: Ch 40B's BUSINESS-FLOW-SPECIFIC rate limiting (distinct
        from general API rate limits), WAAP bot management (Ch 40D) to
        distinguish automated purchasing from real customers, and often
        a genuine PRODUCT decision (queue systems, purchase-limit
        enforcement) as much as a technical one -- this is the newest
        item on the 2023 list and the one most organisations have the
        LEAST existing tooling for, because it sits between security and
        fraud/product teams.

   API7:2023  SERVER SIDE REQUEST FORGERY (SSRF)
     -> CONTROL: Part 6 Ch 33 in full (resolve-validate-pin-connect,
        network isolation, no redirects).

   API8:2023  SECURITY MISCONFIGURATION
     default credentials, verbose errors, missing security headers,
     unnecessary HTTP methods enabled, permissive CORS.
     -> CONTROL: Part 3's IaC/policy-as-code gates (Ch 11), Ch 58's
        SSDLC scanning, G1's CORS/headers material -- this is the
        broadest category and the one MOST addressed by simply running
        the rest of this guide's practices continuously.

   API9:2023  IMPROPER INVENTORY MANAGEMENT
     undocumented, deprecated, or unmonitored API versions/endpoints
     still reachable in production.
     -> CONTROL: Ch 40D's API discovery, Part 7 Ch 41's classification-
        and-inventory discipline applied to the API surface, and a hard
        "no endpoint ships without being in the spec" CI gate (Ch 58).

   API10:2023  UNSAFE CONSUMPTION OF APIs
     trusting data FROM a third-party API (a partner integration, a
     payment webhook, a data-enrichment service) with LESS scrutiny than
     you'd apply to direct user input -- rendering an untrusted field
     without encoding (a stored-XSS vector via "trusted" upstream data),
     following a redirect the third party returned without revalidating
     it (an SSRF-adjacent trust transfer), or deserializing a webhook
     payload without verifying its SIGNATURE first (G1 Ch 11's HMAC/
     webhook-verification material, which THIS item makes explicit as a
     named risk category rather than an implicit best practice).
     -> CONTROL: treat every external API response exactly like user
        input -- output-encode it (G1 Ch 43), verify webhook signatures
        before processing (G1 Ch 11), schema-validate it (Ch 40A) before
        using it, and never assume a partner's data is safe because the
        CONNECTION to them is authenticated (the connection being
        trusted says nothing about the CONTENT being safe).

The two items worth a second look, because they're the ones most teams under-invest in:

   API6 (business flows) sits at the boundary between security and
   fraud/product -- the fix is often organisational as much as technical
   (does your fraud team and your security team even talk to each other
   about the same abuse patterns?). Don't let it fall through that gap
   just because it doesn't look like a classic "vulnerability."

   API10 (unsafe consumption) inverts the direction everyone is trained
   to think in: security review habitually asks "is our INPUT validation
   good enough?" and rarely asks "do we validate what WE receive FROM
   other systems with the same rigor?" Audit your outbound integrations
   with the same checklist you'd apply to an inbound endpoint.

Worked example

Running the full Top 10 as a design-review checklist against a real feature.

   FEATURE: SecureShop adds a "price-match" feature -- customers submit a
   competitor's product URL; the backend fetches that page, extracts a
   price via a third-party price-comparison API, and auto-applies a
   discount if the competitor's price is lower.

   WALKING THE LIST:
     API1 BOLA        -- does GET /price-match/{id} check the requester
       OWNS that price-match request? (Yes/no per Part 5 Ch 25 -- verify.)
     API2 Auth        -- is this endpoint behind the same session/token
       validation as checkout? (Confirm, don't assume "it's just a
       lookup so it's lower risk.")
     API3 Property    -- does the response leak the INTERNAL competitor-
       API's raw response (which might include the competitor's own
       internal identifiers or unrelated fields)? Shape the response to
       exactly the fields the customer needs.
     API4 Resource     -- is there a limit on how many price-match
       requests one account can submit per hour? (Ch 40B business-flow
       limiting -- otherwise this becomes a free, unlimited web-scraping
       proxy for anyone with a SecureShop account.)
     API5 Function     -- can a non-staff account somehow reach an
       internal "force-apply any discount" variant of this endpoint?
     API6 Business flow -- could a bot submit thousands of price-match
       requests to systematically discover pricing/discount logic, or to
       abuse the discount mechanism itself at scale? THIS is exactly the
       new-in-2023 item this feature is most exposed to.
     API7 SSRF         -- the feature FETCHES A USER-SUPPLIED URL. This
       is a textbook Part 6 Ch 33 SSRF surface -- allowlist, resolve-
       validate-pin, no internal targets, no redirects.
     API8 Misconfig    -- is the third-party price-comparison API's
       credential stored per Part 7's secrets discipline, not hardcoded?
     API9 Inventory    -- is this new endpoint added to the OpenAPI spec
       and the WAAP's known-endpoint baseline on day one, not discovered
       three months later as traffic drift?
     API10 Unsafe
     consumption       -- the THIRD-PARTY PRICE API'S RESPONSE is
       rendered to the customer (the competitor's price, maybe a product
       title). Is that response OUTPUT-ENCODED before display? Is its
       JSON schema-validated before being used in a discount calculation
       (a malformed or adversarially-crafted response could otherwise
       manipulate the discount logic itself)?

   RESULT: two items (API7's SSRF surface, from fetching a user-supplied
   URL, and API6's business-flow abuse potential) are the standout risks
   for THIS specific feature, and API10 (trusting the price API's
   response) is the one a typical review would have skipped entirely.
   All ten get a concrete answer, not a shrug -- and the review took
   twenty minutes because every control already exists somewhere in this
   guide; the checklist's job was just making sure someone asked.

Real-world scenario 2: API1, in the clearest possible form

   Brian Krebs reported in November 2018 that the United States Postal
   Service's "Informed Visibility" API -- a legitimate service letting
   businesses track their mail -- contained an authentication flaw that
   let ANY authenticated user, even one with the lowest available
   account privilege, query data belonging to OTHER users' accounts
   simply by supplying a different account identifier in the request.
   USPS confirmed and fixed the issue after being contacted; the
   exposure reportedly affected data on roughly 60 million user
   accounts (account details such as email, username, user ID, account
   number, street address, phone number, and more, depending on the
   query).

   THIS IS API1:2023 (BROKEN OBJECT LEVEL AUTHORIZATION) IN ITS PUREST
   FORM: the API correctly checked that the caller WAS authenticated
   (API2 was fine), but never checked that the OBJECT being requested
   (another user's account record) actually BELONGED to the caller
   making the request. There was no clever bypass, no encoding trick, no
   injection -- just a missing `WHERE owner_id = :caller_id` (G1 Ch 45's
   original framing of this exact bug class) at API scale. It is worth
   sitting with how SIMPLE the root cause was, and how LARGE the blast
   radius became purely because of scale and because nobody had applied
   Ch 40E's ten-item pass -- API1 specifically -- to this endpoint before
   it shipped.

Real-world scenario 3: API2 and API4 together, at large scale and recent

   T-Mobile disclosed in a January 2023 regulatory filing that a
   malicious actor had used a SINGLE API to obtain data associated with
   approximately 37 million current customer accounts, with the
   unauthorised activity beginning around late November 2022 and
   identified/stopped in early January 2023. T-Mobile's own filing
   described the data obtained as including customer name, billing
   address, email, phone number, date of birth, account number, and
   service-plan details -- not payment card or Social Security numbers
   or passwords in this particular incident, per the company's
   disclosure.

   MAPPED TO THIS CHAPTER'S CHECKLIST, TWO ITEMS COMPOUNDED:
     API2 BROKEN AUTHENTICATION   the API's access controls were
       insufficient to prevent this scale of unauthorised querying in
       the first place -- exactly the "weak token validation / missing
       checks on a sensitive flow" shape of API2.
     API4 UNRESTRICTED RESOURCE CONSUMPTION   even setting authentication
       aside, an API that permits ONE caller to pull data on 37 MILLION
       distinct accounts over roughly five weeks reflects an absence of
       the volume-based limits Ch 40B exists to enforce -- a properly
       rate-limited and volume-monitored API (Part 8's DAM/UEBA-style
       baselining, applied at the API-gateway layer) should have flagged
       an anomalous, sustained, large-scale extraction pattern from a
       single caller LONG before it reached tens of millions of records,
       independent of whatever authentication weakness let the querying
       begin at all.

   THE COMPOUND LESSON: this is why Ch 40E's checklist is walked
   ITEM BY ITEM rather than stopping at the first thing found. A review
   that caught and "fixed" only the authentication gap (API2) but never
   asked "and is there ALSO a volume/consumption limit on this data,
   regardless of who's asking" (API4) would have left exactly the
   control that could have caught this incident early, or slowed it to a
   trickle, sitting unbuilt.

Practice (75 min)

  1. Pick a real API endpoint you own. Walk all ten items explicitly, writing one sentence per item: either the specific existing control that addresses it, or a genuine gap.
  2. For any gap found, prioritise it using Ch 59's framework (exposure × reachability × asset criticality) rather than fixing in list order.
  3. Specifically audit for API6: does anything in your system enforce a business-flow-specific limit (not just a general rate limit) on your most valuable/abusable action (a purchase, a signup, a redemption)?
  4. Specifically audit for API10: list every third-party API your system consumes, and for each, confirm whether its response is schema-validated and output-encoded before use, and whether inbound webhooks from it are signature-verified.
  5. Turn this walkthrough into a standing design-review template (Ch 58's Tier 0/1 threat-modeling touchpoint) so every new API feature gets the same ten-item pass before it ships.

Common mistakes

  • Treating the Top 10 as a compliance checkbox rather than a design-review tool. Its value is catching gaps BEFORE ship, using the concrete controls this guide already teaches — not retrofitting a label onto findings after the fact.
  • Skipping API6 and API10 because they don't look like classic vulnerabilities. Both are newer (2023) additions specifically because real-world incidents kept falling into these categories with no existing numbered item to catch them.
  • Confusing API1 (object-level) and API5 (function-level) authorization. They need different checks: "do you own THIS object" vs "does your ROLE permit THIS action at all."
  • Assuming a third-party API's authenticated connection means its data is safe. Authentication proves who sent it; it says nothing about whether the content is safe to render or trust.
  • Running the checklist once at launch and never again. New endpoints, new integrations, and new business flows each need their own pass — wire it into the standing design-review gate (Ch 58), not a one-time audit.

Check yourself

  1. List the ten items of the OWASP API Security Top 10 (2023) and, for each, name the chapter/control in this guide that addresses it.
  2. What's the precise difference between API1 (BOLA) and API5 (BFLA)?
  3. Why is API6 "unrestricted access to sensitive business flows" harder to catch with a purely technical review than most of the other nine items?
  4. Give a concrete example of API10 (unsafe consumption) becoming a stored-XSS vector.
  5. In the price-match worked example, which two items were the standout risks, and why might a typical review have missed the tenth?

Further reading

  • Standard: OWASP API Security Top 10 (2023 edition, owasp.org/API- Security) — read the full document; each item includes example attack scenarios worth comparing against your own systems.
  • Tool: OWASP's own testing guidance and community tooling for API security testing (the API-specific companion to the WSTG referenced throughout this guide).
  • Incident: KrebsOnSecurity's November 2018 report on the USPS "Informed Visibility" API exposure — a clean, minimal-complexity, real-world API1 case study worth reading in full.
  • Incident: T-Mobile's Form 8-K filing with the US Securities and Exchange Commission (January 2023) disclosing the API-related breach affecting approximately 37 million accounts — a primary-source regulatory filing rather than press summary, worth reading directly.
  • Synthesis: re-read Part 5 Ch 25 (authorization), Part 6 Ch 33 (SSRF), Ch 40A-D (this Part) together — the Top 10 is best understood as an index into controls you've already built, not a separate body of knowledge.

End of Part 6A — Milestone check

  • I can build a payload-validation gate with a positive security model (strict schema, additionalProperties: false, size/depth limits) and explain the mass-assignment class of bug it closes
  • I can implement an atomic, distributed rate limiter and explain why a naive check-then-increment is itself a race condition
  • I can name at least three real rate-limit bypass techniques and the specific dimension/fix that defeats each
  • I can explain what a WAF does, deploy one with a real rule set, and demonstrate at least one bypass against it (encoding, content-type mismatch, or request smuggling)
  • I can explain the Capital One breach's WAF/IAM/SSRF chain precisely and state the least-privilege fix for the WAF's own identity
  • I can explain what WAAP adds beyond a WAF (bot management, API discovery, edge schema enforcement, L7 DDoS) and why each is needed
  • I have walked a real API feature through all ten OWASP API Security Top 10 (2023) items and found at least one genuine gap

Generated from real-life-security-guide-v1.md · 8 Oct 2026 16:36