Is request.getAttribute() secure?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Miguel_Angel
Posted On:   Sunday, November 11, 2007 03:45 PM

Hi all, I have a cuestion about security in jsp. Imagine that we have the next portion of jsp file: <% out.println("Hi "+request.getParameter("name")); out.println(""); out.println("Your credit card number is: "+request.getAttribute("cardNumber")); %> Is obvious that if the user insert ""); %> MALICIOUS CODE <% out.println( as his/her name in the source form then our jsp will generate something like this: <% out.println("Hi "+""); %> MALICIOUS CODE <% out.println( ); out.println("");    More>>

Hi all, I have a cuestion about security in jsp. Imagine that we have the next portion of jsp file:



<%

out.println("Hi "+request.getParameter("name"));

out.println("");

out.println("Your credit card number is: "+request.getAttribute("cardNumber"));

%>



Is obvious that if the user insert
""); %> MALICIOUS CODE <% out.println(
as his/her name in the source form then our jsp will generate something like this:



<%

out.println("Hi "+""); %> MALICIOUS CODE <% out.println( );

out.println("");

...

%>



So, the point is the user can play with the values that we recover with getParameter() and Does a malicious user can do the same with values that we recover with getAttribute ?



Thanks in advance.

   <<Less

Re: Is request.getAttribute() secure?

Posted By:   Anonymous  
Posted On:   Wednesday, November 14, 2007 03:31 AM

can you tell me one thing..................

with the same case if we are using request.getParameter()
than also problem will be solve?? i dont think so........still in both cases we will face this problem!!what you think??
About | Sitemap | Contact