Home > Ask the Security Experts > Application Security Questions & Answers > How to prevent cross-site scripting (XSS) session hijacking
Ask The Security Expert: Questions & Answers
EMAIL THIS

How to prevent cross-site scripting (XSS) session hijacking

Michael Cobb, featured expert EXPERT RESPONSE FROM: Michael Cobb, featured expert

Pose a Question
Other Security Categories
Meet all Security Experts
Become an Expert for this site


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


>
QUESTION POSED ON: 10 October 2008
Web applications are always subject to any number of Internet attacks, such as SQL injections and XSS session hijacking. What is the best way to prevent these risks and cut down on the number of the vulnerabilities related to these attacks?


BROWSE BY TAG
Application Security,   Application and Platform Security,   Application Attacks (Buffer Overflows, Cross-Site Scripting),   Web Security Tools and Best Practices,   Web Application Security,   VIEW ALL TAGS

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


RELATED CONTENT
Application Security
Are Web application penetration tests still important?
What does 'invoked by uid 78' mean?
How secure are iPhone App Store mobile applications?
What security software should be installed on Internet café computers?
Are message stubs a secure part of email retention policies?
How does a Web server model differ from an application server model?
Can Google Earth and other mash-up applications threaten enterprise security?
Do European laws prevent a U.S. company from blocking spam?
Can one antivirus program be used to get rid of spyware?
Can USB compromise the security of an embedded mobile device?

Application Attacks (Buffer Overflows, Cross-Site Scripting)
PCI management: The case for Web application firewalls
Month of Twitter Bugs project to document Twitter flaws
Adobe issues first quarterly patch release fixing 13 flaws
Balancing security and performance: Protecting layer 7 on the network
Adobe issues Reader update fixing zero-day flaw
The Pipe Dream of No More Free Bugs
Security Squad: Federal cybersecurity defenses
Oracle issues 43 updates, fixes serious database flaws
Attackers target new Microsoft PowerPoint zero-day flaw
How to detect input validation errors and vulnerabilities
Application Attacks (Buffer Overflows, Cross-Site Scripting) Research

Web Application Security
nCircle statistics show rising Web application vulnerabilities
Twitter bugs, DNSSEC and broswer security
Month of Twitter Bugs project to document Twitter flaws
Are Web application penetration tests still important?
IT pros can detect, prevent website vulnerabilities, thwart attacks
PCI compliance requirement 6: Systems and applications
Trust eroding as social engineering attacks climb in 2009, says Kaspersky expert
US-CERT warns of Gumblar, Martuz drive-by exploits
XSS bugs, information leakage top list of website vulnerabilities
How to find and stop automated SQL injection attacks

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
buffer overflow  (SearchSecurity.com)
cache poisoning  (SearchSecurity.com)
cyberterrorism  (SearchSecurity.com)
dictionary attack  (SearchSecurity.com)
directory harvest attack  (SearchSecurity.com)
distributed denial-of-service attack  (SearchSecurity.com)
JavaScript hijacking  (SearchSecurity.com)
ping of death  (SearchSecurity.com)
stack smashing  (SearchSecurity.com)
SYN flooding  (SearchSecurity.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


The risks you mention have been around a long time, but they're still providing hackers with plenty of opportunities to successfully access data or take control of a compromised machine.

Standard advice for Web application developers is to test application code prior to deployment and promptly patch it as soon as new flaws are reported. But this is no longer enough, as today's attackers are more thorough in how they seek out vulnerable websites. Hackers use a variety of toolkits to speed up the exploitation process, and recent attacks show that vulnerabilities are now more likely to be uncovered and exploited maliciously.

To reduce the chances of your application falling victim to an attack, it's essential that any Web application development is undertaken using a "security development lifecycle" approach. The aim of the security development lifecycle is to reduce the number of security-related design and coding defects, and to reduce the severity of any defects that do remain undetected.

As part of this process, you should incorporate threat modeling. Performed during the application design stage, threat modeling identifies and evaluates the risks to an application. In order to identify potential threats to the application, assets must be categorized, along with sensitive information that the application accesses. Threat modeling not only raises security awareness among developers, but also makes security an integral part of the application design and development process. By having security professionals and developers work together, it's easier to analyze an application from an attacker's point of view. For more help, download Microsoft's free Threat Modeling Tool.

On larger projects, consider automatic source code-scanning tools and Web vulnerability scanners. A good Web vulnerability scanner will spot common technical vulnerabilities, such as SQL injection flaws, cross-site scripting vulnerabilities, parameter tampering, hidden field manipulation, backdoors, debug options and buffer overflows. Custom application code, however, will still need manual reviewing, particularly if it uses Ajax. Ajax increases the possible permutations of user and service interaction, which makes automated testing difficult, since scanners can only process syntactic information. Until scanners can harness true artificial intelligence and put the anomalies into context or make normative judgments about them, they will struggle to find certain types of vulnerabilities.

For applications that use open source components, be aware of the emerging threat of cross-build injection, in which attackers insert malicious code into applications even as they are being built. The attack is a good example of how malicious hackers look at every aspect of the application development and deployment lifecycle to find where they can take advantage of weaknesses to plant their code.

The end result of Web applications built using security development lifecycle methodology will be a reduction in the number of vulnerabilities that make it through to the release version. Since the cost of fixing vulnerabilities in a live production environment is so much higher than addressing them during development, a security development lifecycle helps to create better products, increase customer confidence in your applications, and benefit the bottom line.

Having spent time ensuring your Web application is robust, you still need to conduct penetration tests to ensure that your Web server and database server have been hardened and are well-protected, too. By simulating an attack, you can evaluate whether your Web application has any potential vulnerabilities resulting from poor or improper system configuration, hardware or software flaws or weaknesses in the perimeter defenses protecting the site. Finally I recommend reading the Open Source Security Testing Methodology Manual. The free guide provides a recognized methodology for performing security tests and measuring the results.

More information:

  • In 2008, one SQL injection attack infected hundreds of thousands of websites.
  • See which new tactics can prevent cross-site scripting attacks.




  • Search and Browse the Expert Answer Center
    Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
    Browse our Expert Advice



    Find Security Solutions for Your Business
    Targeted Security Channel Tips for Resellers, Integrators and Consultants
    TechTarget Security Media
    Information Security View this month\\'s issue and subscribe today.
    Information Security Decisions Apply online for free conference admission.
    SearchSecurity.com
    HomeNewsMagazineMultimediaWhite PapersLearningAdviceTopicsEventsAbout Us

    About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
    TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

    TechTarget Corporate Web Site  |  Media Kits  |  Site Map




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