logo

169 Use parameterized queries


Summary

The system must use parameterized queries or stored procedures to create dynamic sentences (e.g., java.sql.PreparedStatement).


Description

One of the main reasons for using parameterized queries or stored procedures is to prevent SQL injection attacks. When applications concatenate user input directly into SQL statements, attackers may inject malicious SQL code, potentially leading to unauthorized access or data manipulation. Parameterized queries ensure that user input is treated as data, not as executable code, mitigating the risk of SQL injection.


Supported In

Essential: True

Advanced: True


References


Weaknesses


Last updated

2024/01/18