| Author |
Remove unexpected carriage returns and line feeds from user-supplied data
|
ravisha andar
Ranch Hand
Joined: Feb 25, 2011
Posts: 55
|
|
Hi All,
I have a servlet where I am doing
String userName="abc";
response.sendirect("/jsp/temp.jsp?username="+userName);
But there is a vulnerability as stated by review team
It says
Remove unexpected carriage returns and line feeds from user-supplied data used to construct an HTTP response.
Can anybody help me with this ? What exacltly can be done?
Thanks
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56554
|
|
First of all, the data should be encoded using URLEncoder.
Secondly, stripping any unwanted characters seems like a simple matter of string substitution.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: Remove unexpected carriage returns and line feeds from user-supplied data
|
|
|