How are input keys exploitable by malicious users?

后端 未结 5 1108
清歌不尽
清歌不尽 2020-12-29 23:14

In the CodeIgniter PHP framework, there is a function that automatically runs on each request that, among other things, filters the GET/POST/COOKIE array keys, and kills the

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 23:56

    Your question, in itself, brings up a good point: it's unclear what exactly you're being protected against. But there are some popular items it could be addressing:

    • magic quotes
    • things that could eventually lead to SQL injection
    • strings that could be executed by way of shell commands
    • things that could conflict with your URL
    • things that could conflict with HTML
    • things that resemble a directory traversal attack
    • cross site scripting (XSS) attacks

    But other than those, I really can't think of why you'd always why you'd want to generally protect via preg_match("/^[a-z0-9:_\/-]+$/i", $str).

    I've got the feeling that they're overprotecting simply because CodeIgniter is so widely used that they need to protect against things they themselves haven't thought of yet for the sake of their users who may be even less-aware of such attacks than CodeIgniter's developers.

提交回复
热议问题