liveBook · Manning

Unique identifier

As explained in Secure APIs

A database identifier is a value that uniquely distinguishes a stored record or entity within a database.

A unique identifier distinguishes one stored record or API resource from another. APIs use these values to locate and retrieve payments, orders, users, and other resources. Incremental database identifiers are efficient and acceptable internally; exposing them directly can reveal a predictable sequence. section 6.2

An attacker can change an identifier in a resource URI, such as /payments/{payment_id}, to enumerate resources. If authorization and access controls are weak, predictable identifiers can enable broken object-level authorization and data breaches. Secure API design therefore avoids exposing predictable resource IDs and addresses security before deployment. section 6.2 section 1.2.1

Payment resource enumeration

A payment returned with ID 1 and a later payment returned with ID 2 expose an incremental pattern. A tester may try other values in /payments/1, /payments/2, and neighboring paths to find resources that should remain inaccessible. section 6.2

Figure 6.4 When an API uses a predictable pattern to identify resources, such as incremental integer IDs, threat actors will play with those values to try to access resources that don’t belong to them.
figure

Shows how predictable resource identifiers invite attempts to access resources belonging to other users. section 6.2

How Secure APIs covers it

How deep it goes
Explains identifier use, predictable sequences, enumeration, and BOLA consequences, but does not specify replacement identifier formats.
Examples
Uses payments and orders APIs, /payments/1 paths, incremental IDs, and a user-record leak involving Clubhouse.
What you can do after
Evaluate APIs for predictable identifiers and identifier-manipulation paths that could expose unauthorized resources.
How it connects
Connects resource identifiers with primary keys, resource enumeration, authorization, access controls, and BOLA.

Also explained in

Compare how 9 books explain unique identifier →

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.