A simple diagram of the Improper Data Validation risk path
Risk path: an input or context crosses a security boundary.
A simple three-step test path for Improper Data Validation
Testing path: establish a baseline, make one controlled change, and verify the effect.

01Issue

Overview

Validation is the server-side check that a value is allowed for a field and for the action using it. A value may have the right shape but still be invalid for the current user or state: a quantity can be numeric but too large, or an end date can be valid by itself but earlier than its start date. The application should validate the canonical value it will actually store or process. Validation does not replace authorization, parameterized queries, or output encoding; each addresses a different risk.

Common causes

  • The browser enforces a limit but the server does not repeat it.
  • Different routes or services apply different rules to the same field.
  • The application validates before decoding or normalizing, then processes a different value.
  • The application checks fields individually but misses rules between them, such as price and quantity.

References: OWASP Input Validation Cheat Sheet ↗OWASP WSTG: Business Logic Data Validation ↗

02Examples

EXAMPLE

Illustrative API field: quantity is an integer from 1 through 20. Compare {"quantity":20}, {"quantity":21}, and {"quantity":"20"} against the same test order. Record the response and final order state. If 21 is accepted, that confirms the range rule is missing on this path; it does not establish a financial impact until the order behavior is checked.

03Impact

A user can submit a value outside the feature’s intended rules, and a server-side component accepts or acts on it. A security finding needs an observable effect on data, a decision, or a later process; a client-side validation bypass alone is not enough.

Depending on the field, weak validation can create invalid records, bypass business limits, break downstream processing, or feed unsafe data into another component. The demonstrated result determines the impact: accepting an unusual value does not by itself prove data access, privilege change, or code execution.

04Testing

Test cases

1. Check whether invalid values change a protected action

Capture a valid test operation, then change one value beyond the allowed business range. Verify the saved record or transaction.

Example: A negative quantity may affect an order total. Check the stored order rather than assuming an unusual response proves impact.

POST /api/orders HTTP/1.1
Host: app.example.test
Content-Type: application/json
 
{"item":"TEST-1","quantity":-1}

2. Compare types and related fields

Send unexpected types, missing values, and inconsistent related fields to the same endpoint. Compare the response and state with a valid baseline.

Example: A string may be sent where a number is expected. Review how the application handles it.

POST /api/orders HTTP/1.1
Host: app.example.test
Content-Type: application/json
 
{"item":"TEST-1","quantity":"many"}

3. Compare browser and server validation

Repeat an input that the browser form rejects using the underlying request. Review create, update, and import paths that accept the same data.

Example: A disabled button does not enforce a server rule. Confirm the server’s behavior directly.

Testing references: OWASP Input Validation Cheat Sheet ↗OWASP WSTG: Business Logic Data Validation ↗

05Mitigation

Define a server-side schema for each endpoint and validate type, format, length, range, allowed values, and relationships between fields. Normalize before validation and use that same normalized value afterward. Reject unknown fields where practical. Keep authorization, query parameterization, and output encoding as separate controls because input validation cannot replace them.

Retest

Repeat each boundary, wrong-type, normalization, and cross-field case. Confirm invalid values are rejected before persistence or processing, valid values still work, and other routes that accept the same data follow the same rules.