Back to overview

Data validation & encoding 6

Centralized input validation routines are a good programming practice, but like other routines, developers need to understand how they work, how to use them and any limitations. Such routines can be tested independently of other code and not only provide assurance on the quality of the input validation, but it make refactorization an easy task and eliminate code duplicates and bad interpretations. Use of white list validation is recommended where possible. Black lists are usually good as a double-check complement, as they can trigger alerts for fake positives. Common attacks to bad implementation (or lack) of validation rutines are:

Buffer overflows. Code injection. Fuzzing. If third party input validation libraries are used, it is important to test each routine before its implementation.

NB: This card relates to bypass of input data validation. See VE 5 for the similar bypass of output encoding.

How to play?

Jason can bypass the centralized validation routines since they are not being used on all inputs

Mappings

Owasp ASVS (4.0): 1.1.6 ,1.5.3 ,5.1.3 ,13.2.2 ,13.2.5

Capec: 28

Owasp SCP: 3,168

Owasp Appsensor: IE2-3

Safecode: 3,16,24

ASVS (4.0) Cheatsheetseries Index

ASVS V1.1 - Secure Software Development Lifecycle Requirements

ASVS V1.5 - Input and Output Architectural Requirements

ASVS V5.1 - Input Validation Requirements

ASVS V13.2 - RESTful Web Service Verification Requirements

Attacks

SQL Injection

Cross-Site Scripting (XSS)

(Session) Data tampering

Privilege escalation

Loading comments 0%

Github logo View source on GitHub

Provided by dotNET lab

This website is created, hosted and provided by dotNET lab. dotNET lab provides training and guidance on secure software development. Contact us to get in touch!

OWASP Cornucopia

OWASP Cornucopia is originally created by Colin Watson. It is open source and can be downloaded free of charge from the OWASP website. It is is free to use. It is licensed under the Creative Commons Attribution-ShareAlike 3.0 license, so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one. OWASP does not endorse or recommend commercial products or services. OWASP Cornucopia is licensed under the Creative Commons Attribution-ShareAlike 3.0 license and is © 2012-2016 OWASP Foundation.