Is SQL injection a risk today?

前端 未结 20 2097
暗喜
暗喜 2020-12-05 13:25

I\'ve been reading about SQL injection attacks and how to avoid them, although I can never seem to make the \"awful\" examples given work, e.g. see this post

20条回答
  •  醉梦人生
    2020-12-05 13:50

    The simplest rule of thumb is to assume that all user input can be tainted. Check that data types are what you expect, variables are in the length/size ranges you were expecting, files are of the size and types you allow, etc. Other checks on non-external data can be warranted - before you call some important admin-level function, do a check - ($userlevel != ADMIN)?die():important_function();

    There's always a bigger fish, or somebody who's a bigger jerk than you. Avoid assumptions about data and you've got a head start.

提交回复
热议问题