liveBook · Manning

Unconstrained user input

As explained in Secure APIs

Unconstrained user input is client-supplied data accepted by an API without effective restrictions on its values, size, type, or format.

Unconstrained user input is client-supplied data accepted by an API without effective limits on values, size, type, or format. It can appear in request bodies, URL query and path parameters, or headers. Because this data reaches business and data layers, attackers can use it to overload systems, trigger errors, expose hidden fields, or inject database commands. section 6.3

Constrain inputs at the API boundary:

  • Validate directly at the API rather than relying on a web or mobile client to restrict choices. section 6.3

Book review endpoint

An unconstrained review schema accepts POST /books/1/reviews with {"rating": 500} and permits unbounded review text. A safer schema restricts rating to 1–5 and review text to 2,000 characters.

How Secure APIs covers it

How deep it goes
Demonstrates numeric, string, pagination, sorting, and injection failures before showing schema constraints.
Examples
Uses pagination limits, book reviews, SQL-injection payloads, and unconstrained sort fields as concrete failure cases.
What it assumes
Assumes familiarity with API requests and parameters while teaching their role through ordering, payment, booking, and catalog examples.
What you can do after
Operate/configure APIs by applying numeric bounds, string limits, enumerations, and server-side validation.
How it connects
Connects input validation with API security, pagination, SQL injection, resource exhaustion, and information disclosure.

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.