Sanitization
Sanitization is an additional protection in my ORM system
Sanitization in my ORM provides protection against SQL injection and other potential vulnerabilities by cleaning input data before it is used in queries. To enable sanitization, you need to create an instance of DatabaseManager
with the sanitizer: true
parameter:
The sanitizer is implemented through the Sanitizer
class, which processes input data based on its type (string, number, or identifier). It uses various methods for data cleaning, including:
Number Sanitization: Converts input data into numbers and checks their validity.
Identifier Sanitization: Checks length, format, and the presence of reserved SQL words.
Automatic Sanitization: Handles different data types such as HTML, XML, JSON, URLs, file paths, shell commands, and others.
Examples of Data Before and After Sanitization:
Data Before Sanitization:
Data After Sanitization:
Sanitization in my ORM helps keep queries safe by cleaning incoming data from unwanted characters and potential threats. It includes protection against SQL injections, XSS attacks and other types of vulnerabilities. This functionality is currently under development, so some bugs or flaws may be discovered.
Last updated