Proving SQL Injection

后端 未结 5 1073
旧巷少年郎
旧巷少年郎 2021-01-01 01:24

I\'m trying to simply prove here that this simple function isn\'t good enough to prevent every sql injection in the world:

Function CleanForSQL(ByVal input A         


        
5条回答
  •  臣服心动
    2021-01-01 01:48

    You're not doing anything wrong. This is how SQL Server parses strings. The first quote opens the string, then you've followed that immediately with an escaped quote followed by Chr(8).

    As an exercise, what happens if you run this in SQL Server: SELECT '''Hello'? Exactly the same parsing rules are being applied in this case.

提交回复
热议问题