liveBook · Manning

Resource enumeration

As explained in Secure APIs

Resource enumeration is the process of discovering which resources exist by probing an application's responses.

Resource enumeration discovers which resources exist by manipulating identifiers in resource URLs. With an endpoint such as /payments/{payment_id}, sequential IDs invite probing for records belonging to other users. section 6.2

Enumeration becomes a data-breach risk when predictable IDs meet weak authorization. Attackers can scan resources, while response timing can also reveal information through a side-channel. section 6.2 section 4.3

Reduce the opportunity to enumerate resources by:

  • Avoid exposing predictable identifiers directly through the API; use string-based identifiers at the database or application level. section 6.2
  • Check that the authenticated user has rights to the requested resource, and test every endpoint for BOLA. section 4.3
  • Look for response-time differences that disclose whether resources exist, then consider consistent response times. section 4.3

Orders endpoint

A request for /orders/1 may return an order without confirming ownership. Querying by both order ID and the authenticated user's identity prevents access to another user's order.

How Secure APIs covers it

How deep it goes
Defines identifier probing, connects it to BOLA and timing leaks, and gives endpoint tests and ownership-checking code.
Examples
Uses payment and order URLs, sequential IDs, curl requests, and ownership-filtered database queries.
What it assumes
Assumes basic familiarity with API resource URLs, authenticated requests, and database-backed records.
What you can do after
Diagnose enumeration and BOLA risks by manipulating resource IDs, testing endpoints, and checking ownership constraints.
How it connects
Connects predictable identifiers, BOLA, authorization, authentication, side-channel attacks, and timing attacks.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Secure APIs. The section links point to the parts of the book it draws on.