OOmnistu

Blog / Engineering Playbooks

Engineering Playbooks

Input validation: what your app should check before it trusts a form or API request

Review expected input types, formats, sizes and server-side checks before an app trusts form fields or API requests.

OOmnistu
Reviewed 2026-11-16 · 3 min read

Every form field, API parameter and uploaded file is data from outside your system. OWASP's Input Validation Cheat Sheet (https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html) defines input validation as checking whether data meets the application's requirements before the application uses it. It reduces the risk of malformed data, invalid business operations and excessive resource consumption.

Validation is not the only defence

OWASP is explicit that validation sits alongside other controls: parameterized queries for SQL, context-aware output encoding for cross-site scripting (XSS), and separate authorization checks. A valid account identifier does not mean the caller may access that account.

Check syntax and meaning

Syntax is the expected type and format; semantics is whether the value makes sense for the operation. OWASP's example: a booking needs valid dates and an end date after its start date. It suggests rules per field: fixed choices must match an allowed set (including values from drop-down menus), numbers and dates need type, format and min/max, strings need length limits and structure, objects need allowed and required fields, and arrays need item-count limits with every item validated.

Allowlist, not denylist

OWASP says to define what is accepted and reject the rest, not to try to recognise every malicious string. Its example: blocking apostrophes rejects legitimate names without making a database query safe. For free-form comments, an allowlist can permit broad Unicode text with a length limit.

Practical points from the cheat sheet

Common pitfalls OWASP lists

Client-only checks (browser checks are bypassable; validate on the server), trusting internal sources such as partner feeds or queues, "cleaning" input by removing characters, stopping at the outer fields of nested data, assuming regex or Unicode normalization makes data safe, trusting upload metadata, and logging rejected input verbatim.

Questions for your developer

  1. Is every field validated on the server, with explicit length, range and allowed values?
  2. Do we reject unknown fields and oversized requests early?
  3. Are SQL queries parameterized, and is output encoded, independent of validation?
  4. How do we handle uploads and user-supplied HTML?

Limits

We did not read the linked cheat sheets on file upload, deserialization, mass assignment or email verification. This is an overview, not a security review.

By Omnistu.

Sources

Previous
HTTP caching for business sites: what to cache, what never to share