SQL_DEBUG: QUERY command[]: delete from foo where id=181 or 1=1
SQL_DEBUG: AFTER NORM : delete from foo where id=? or ?=?
SQL_DEBUG: RISK : 0
SQL_DEBUG: QUERY command[]: delete from s where comment = 'whatever' or '1'='1'
SQL_DEBUG: AFTER NORM : delete from s where comment = ? or ?=?
SQL_DEBUG: RISK : 0
| 筆者做了許多嘗試,結(jié)果都是一樣的,即GreenSQL都將前面的不懷好意的查詢的風(fēng)險看成是零,筆者又試用了一下SELECT查詢。這竟然 是使GreenSQL工作的一個關(guān)鍵,即可以阻止惡意查詢,如日志文件的一個片斷部分所示:
SQL_DEBUG: QUERY command[]: select * from folks where name='sam' or '1'='1'
SQL_DEBUG: AFTER NORM : select * from folks where name=? or ?=?
DEBUG: Query has 'or' token
DEBUG: Variable comparison only
SQL_DEBUG: RISK : 35
|
由于select語句中的SQL注入允許用戶在沒有口令的情況可以登錄進入一個站點,讓GreenSQL檢查一下你的select未嘗不是一個好主 意。不過,筆者希望GreenSQL的未來版本可以將保護擴展到delete語句,因為它可以清除整個數(shù)據(jù)表。 本新聞共 3頁,當(dāng)前在第 3頁 1 2 3 |