Another issue with SQLite and SQL statements generally is SQL injection attacks. These can deface websites, result in data corruption, and also affect the reputation of your website and its customers. If the input to SQL parameters is direct, then a weakness could be penetrable. SQL data input must be checked and filtered to allow no one to change the current statement with data elements or even replace SQL statements to perform corrupt acts. This can be done using this statement:
SELECT * from property where property_name='%s';
The preceding code shows that an injection can take place where %s
is the input string, and it can be changed to be something else, thus changing the outcome result. To protect SQL, constrain the input, use parameters with stored procedures, and use parameters with dynamic SQL to reduce the threats.
To prevent your website from being used for XSS
or XSRF
attacks, disallow the HTML tags in text input provided by users by using functions to find and strip tags.