Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

preventing my application from sql injection?

I am making a project in which i have a login page.

i am restricting user to enter

AND OR NOT XOR & | ^

is this enough to prevent my application from SQL Injection?

like image 614
Javed Akram Avatar asked Dec 02 '25 08:12

Javed Akram


1 Answers

No, not at all.

For example, I could still enter my username as:

; DELETE FROM Users --

Which could still, depending on your DB structure and application code, wipe your entire Users table.

To adequately protect yourself from SQL Injection attacks you should escape any user input and use either parameterized queries or stored procedures (and if you're using stored procedures, be sure you don't have dynamically generated SQL inside the stored procedure) to interact with the database.

like image 135
Justin Niessner Avatar answered Dec 03 '25 22:12

Justin Niessner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!