Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Cross Site Scripting implementation

Posted on 2012-03-14
7
Medium Priority
?
730 Views
Last Modified: 2012-03-16
Hi All

There was some penetrating tests that was conducted in our existing production java application, and one of the recommendation is to address cross site scripting.

I need inputs from experts on implementing this cross side without the need make changes in every artifact

something like setting up some config file, etc if possible

Regards
0
Comment
Question by:Srirampriya
  • 3
  • 2
  • 2
7 Comments
 
LVL 42

Assisted Solution

by:Meir Rivkin
Meir Rivkin earned 1050 total points
ID: 37723661
i'd start with this link:
http://www.veracode.com/security/xss

the video by Chris Eng describes well what XSS means and ways to prevent it.

The following is taken from XSS Cheat Sheet from their website:
To prevent Cross-site Scripting vulnerabilities, you should URLEncode all user input that is returned as part of URLs. This will convert ?, &, /, <, >, and spaces to their respective URL encoded equals. Additionally, you should HTMLEncode all user input returned as part of HTML. This will also convert special characters into their respective HTML encoded equals. Last but not the least, you should convert all user input to a single character encoding before parsing. This applies to Single/Double Hex Encoding, Unicode Encoding, and UTF-8 Parsing.
In order to avoid Cross-site Scripting vulnerabilities, you can perform the following actions:
1. URLEncode all user input returned as part of URLs (convert ?, &, /, <, >, and spaces to their respective URL encoded equals).
2. HTMLEncode all user input returned as part of HTML.
3. Convert all user input to a single character encoding before parsing.

cheers
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 37723852
Use filter concept or interceptor concept .....

when all your request/response goes to filter or interceptor .. then you cant get the form values in the URL.  you can stop Corss Site scripting .
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 37723900
In Filter you can do set encoding or URLEncode.
0
Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

 

Author Comment

by:Srirampriya
ID: 37725570
Hi Dravid

could you share some reference or code fragments on this.

also I do not want to change in all my files. can you please explain a bit
0
 
LVL 42

Assisted Solution

by:Meir Rivkin
Meir Rivkin earned 1050 total points
ID: 37725649
0
 
LVL 20

Accepted Solution

by:
Sathish David  Kumar N earned 450 total points
ID: 37726263
0
 

Author Closing Comment

by:Srirampriya
ID: 37728311
Need to try
0

Featured Post

WatchGuard Case Study: Museum of Flight

“With limited money and limited staffing, we didn’t have a lot of choices in terms of what we could do to bring efficiency. WatchGuard played a central part in changing that.” To provide strong, secure Wi-Fi access within the museum, Hunter chose to deploy WatchGuard’s AP120 APs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
Phishing emails are a popular malware delivery vehicle for attack.  While there are many ways for an attacker to increase the chances of success for their phishing emails, one of the most effective methods involves spoofing the message to appear to …
This video teaches viewers about errors in exception handling.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question