Inconsistent Validation
What is Inconsistent Validation?
Inconsistent Validation occurs when various components of an application validate user input in differing manners.
Example:
Result? A hacker can circumvent the frontend and directly send harmful input to the backend.
Common Examples
Frontend validations are implemented (JavaScript), yet the backend fails to revalidate.
Attackers can disable JavaScript or utilize tools such as Burp Suite to bypass these checks.
One API endpoint validates the format of an email; another does not.
Attackers exploit the less secure one to inject malicious payloads.
The user interface restricts input to 100 characters, while the database permits 255.
Hackers can send 255-character payloads containing hidden scripts or injections.
Certain modules sanitize HTML, while others do not.
This inconsistency leads to varying levels of XSS protection.
Why It’s Dangerous
Recommended by LinkedIn
How to Prevent Inconsistent Validation
Frontend validation enhances user experience — it is not a substitute for security.
Employ shared libraries or middleware to ensure consistent data validation throughout the application.
Only accept known-good input, rather than merely blocking known-bad input.
Length, format, and data type must be consistent across the UI, APIs, and database.
Assume that attackers can bypass the user interface. Validate all inputs on the server side.
Utilize tools such as ZAP, Burp Suite, or custom scripts to identify potential bypasses.
Developer Tip
If validation is not consistent, your application is only as secure as its weakest checkpoint.
Ensure that every layer of your application communicates uniformly regarding validation.
#InputValidation #WebSecurity #CyberSecurity #AppSec #OWASP ADITH AJITHKUMAR Shonith Mohan TBH