![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Greetings, Not one to second-guess users' intentions, I like to throw back at them any text input that didn't make it through a couple of basic preg_match()'d sanity checks. This means reloading the form with the _unaltered_ input as respective 'value' attributes, combined with a friendly error message for the merely befuddled. |
|
The downright vicious may choke on their own pathetic attempts at XSS. |
|
But, how sane is such an approach from a security perspective? Is there anything that might come around and bite me in the ass? |
#3
| |||
| |||
|
|
*If* that's true, then the input can be used as an XSS attack - they'll just have to lure some unsuspecting victim to the error/feedback page you created. |
#4
| |||
| |||
|
|
Joost Diepenmaat: *If* that's true, then the input can be used as an XSS attack - they'll just have to lure some unsuspecting victim to the error/feedback page you created. None of the returned values will ever be stored in a session (or make it into the database), so I assume that hijacking and/or redirection will not be an issue. Put another way around, if the attacker's browser will be the only client to display rouge input, what's the harm to the rest of us? |
#5
| |||
| |||
|
|
The attacker is the person who creates the link (or form, if it's a POST-based attack instead). The victim is the person who gets tricked into clicking on it. They don't need to be the same person. |
![]() |
| Thread Tools | |
| Display Modes | |
| |