|
1. What is Cross Site Scripting?
Cross Site Scripting
(or XSS) is one of the most common application-layer web attacks. XSS
commonly targets scripts embedded in a page which are executed on the
client-side (in the user’s web browser) rather than on the server-side.
XSS in itself is a threat which is brought about by the internet
security weaknesses of client-side scripting languages, with HTML and
JavaScript (others being VBScript, ActiveX, HTML, or Flash) as the
prime culprits for this exploit. The concept of XSS is to manipulate
client-side scripts of a web application to execute in the manner
desired by the malicious user. Such a manipulation can embed a script
in a page which can be executed every time the page is loaded, or
whenever an associated event is performed.
A basic example of XSS is when a malicious user injects a script in
a legitimate shopping site URL which in turn redirects a user to a fake
but identical page. The malicious page would run a script to capture
the cookie of the user browsing the shopping site, and that cookie gets
sent to the malicious user who can now hijack the legitimate user’s
session. Although no real hack has been performed against the shopping
site, XSS has still exploited a scripting weakness in the page to snare
a user and take command of his session. A trick which often is used to
make malicious URLs less obvious is to have the XSS part of the URL
encoded in HEX (or other encoding methods). This will look harmless to
the user who recognizes the URL he is familiar with, and simply
disregards and following ‘tricked’ code which would be encoded and
therefore inconspicuous.
2. Site owners are always confident, but so are hackers!
Without going into complicated technical details, one must be aware
of the various cases which have shown that XSS can have serious
consequences when exploited on a vulnerable web application. Many site
owners dismiss XSS on the grounds that it cannot be used to steal
sensitive data from a back-end database. This is a common mistake
because the consequences of XSS against a web application and its
customers have been proven to be very serious, both in terms of
application functionality and business operation. An online business
project cannot afford to lose the trust of its present and future
customers simply because nobody has ever stepped forward to prove that
their site is really vulnerable to XSS exploits. Ironically, there are
stories of site owners who have boldly claimed that XSS is not really a
high-risk exploit. This has often resulted in a public challenge which
hackers are always itching to accept, with the site owner having to
later deal with a defaced application and public embarrassment.
3. The repercussions of XSS
Analysis of different cases which detail XSS exploits teaches us how
the constantly changing web technology is nowhere close to making
applications more secure. A thorough web search will reveal many
stories of large-scale corporation web sites being hacked through XSS
exploits, and the reports of such cases always show the same recurring
consequences as being of the severe kind.
Exploited XSS is commonly used to achieve the following malicious results:
- Identity theft
- Accessing sensitive or restricted information
- Gaining free access to otherwise paid for content
- Spying on user’s web browsing habits
- Altering browser functionality
- Public defamation of an individual or corporation
- Web application defacement
- Denial of Service attacks
Any site owner with a healthy level of integrity would agree that
none of the above can really be considered us frivolous or unimportant
impacts on a vulnerable site. Security flaws in high-profile web sites
have allowed hackers to obtain credit card details and user information
which allowed them to perform transactions in their name. Legitimate
users have been frequently tricked into clicking a link which redirects
them to a malicious but legitimate-looking page which in turn captures
all their details and sends them straight to the hacker. This example
might not sound as bad as hacking into a corporate database; however it
takes no effort to cause site visitors or customers to lose their trust
in the application’s security which in turn can result in liability and
loss of business.
|