input sanitization

Cleaning input by removing or escaping dangerous parts, such as HTML tags, before storing or displaying it.

In more detail

Validation rejects bad input; sanitization transforms it. Escaping on output, for the place the data is used, is usually more reliable than trying to strip dangerous parts on input.

Example

React escapes text it renders, which prevents most script injection in Next.js pages.

Related terms

Taught in

References