Valid Email Addresses - XSS and SQL Injection

前端 未结 2 2219
生来不讨喜
生来不讨喜 2021-02-19 13:48

Since there are so many valid characters for email addresses, are there any valid email addresses that can in themselves be XSS attacks or SQL injections? I cou

2条回答
  •  别那么骄傲
    2021-02-19 14:30

    Spaces are allowed if they are enclosed in quotes, however, so "'OR 1=1--"@gmail.com is a valid e-mail address. Also, it's probably less of a concern, but technically speaking, these are both valid e-mail addresses:

    ' BAD SQL STUFF -- 
    fake@ryanbrunner.com (' BAD SQL STUFF --)
    

    Even if this wasn't possible, there's still no reason that you shouldn't be using paramaterized queries and encoding all user-inputted data displayed to users.

提交回复
热议问题