liveBook · Manning

Property enumeration

As explained in Secure APIs

Property enumeration is an exploit that reveals fields of an application's data models that are not intended for external users.

Property enumeration is an exploit that reveals fields in an application's data models that should remain hidden from external users. Attackers can expose these fields through seemingly harmless API parameters. section 3.1

Sorting by a hidden field

Suppose GET /products accepts sort_by for price or average review. If the API accepts any word, an attacker can request sort_by=stock and learn each product's remaining inventory. That information can support scalping: buying scarce products to resell them at higher prices. A regular expression that blocks spaces or SQL syntax may stop SQL injection while still allowing this attack. section 3.1

Prevent property enumeration by:

  • Constraining sort_by to an explicit enumeration of permitted fields, rather than accepting arbitrary property names. section 3.1
  • Assessing API security early and repeatedly during development instead of relying only on end-stage security tests. section 3.1

How Secure APIs covers it

How deep it goes
Explains the attack, business consequence, failed regex fix, and explicit-enumeration mitigation without detailing implementation internals.
Examples
Uses a products sorting endpoint, a hidden stock field, regex filtering, and an explicit sort-field enumeration.
What you can do after
Operate/configure API query parameters with explicit allowed values and test security before production deployment.
How it connects
Connects property enumeration with API security, SQL injection, security by design, and scalping.

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.