SQL Injection in Java and MySQL when using multiple queries

后端 未结 3 509
野性不改
野性不改 2020-12-20 03:44

I\'ve got a web application with an SQL injection as part of an INSERT statement. It looks like this:

INSERT INTO table1 VALUES (\'str1\', 1, \'INJECTION HER         


        
3条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-20 04:15

    As explained in this post, there are more bad things that can happen to your application than the classic table DROP:

    • call a sleep function so that all your database connections will be busy, therefore making your application unavailable
    • extracting sensitive data from the DB
    • bypassing the user authentication

    Bottom line, you should never use string concatenation when building SQL statements. Use a dedicated API for that purpose.

提交回复
热议问题