What Is Input Validation and Sanitization? |
||||
Validation checks if the input meets a set of criteria (such as a string contains no standalone single quotation marks). Sanitization modifies the input to ensure that it is valid (such as doubling single quotes). Oracle Database provides a PL/SQL package called DBMS_ASSERT, which contains functions that can be used to filter and sanitize input strings. DBMS_ASSERT is discussed in more detail in Lesson 5: Filtering Input with DBMS_ASSERT of the tutorial. To avoid SQL injection, all input that are to be concatenated in dynamic SQL must be correctly filtered and sanitized. |