Cross Site Scripting

Cross site scripting (XSS) is a type of computer security exploit where information from one context, where it is not trusted, can be inserted into another context, where it is. From the trusted context, an attack can be launched. Note that although cross site scripting is also sometimes abbreviated "CSS", it has nothing to do with the Cascading Style Sheets technology that is more commonly called CSS. A classic example of cross site scripting is to supply parameters to a CGI script on a web site which cause the web site to emit bogus data. For example, the use of HTML client-side scripting language fragments in a web page parameter may insert this information into the rendered page, resulting in targeted web browsers executing the code. This may be done by entering data into a web form on the site, for example as part of a bulletin board feature, or by publicly posting a URL which users are likely to click on, for example in e-mails or Usenet. Note that despite the name, as example 2 demonstrates, this type of attack does not require the use of scripts. Example 1:
  1. UserA trusts example.com to run JavaScript on his machine.
  2. UserB has found a way to inject/insert his/her own JavaScript code into example.com (for example into a bulletin board message) and inserts a malicious script that asks for people's credit card numbers and stores them somewhere where UserB can access them.
  3. UserA visits example.com and UserB's script asks for his/her credit card number. Thinking that this is a legitimate request from example.com, UserA blissfully provides his/her credit card number.
  4. UserB has effectively "stolen" UserA's credit card number using cross-site scripting and some social engineering.
Example 2:
  1. UserA has an account at example.com and is logged in.
  2. UserB has found a way to inject/insert his/her own HTML into example.com (for example into a bulletin board message) and inserts a form that asks for people's credit card numbers and stores them somewhere where UserB can access them.
  3. UserA visits example.com and UserB's form asks for his/her credit card number. Thinking that this is a legitimate request from example.com, UserA blissfully provides his/her credit card number.
  4. UserB has effectively "stolen" UserA's credit card number using cross-site scripting and some social engineering.
Example 3:
  1. UserA has an account at example.com and is logged in.
  2. UserB injected a piece of JavaScript to retrieve the session ID of the current user and send it to him/her.
  3. UserA visits the manipulated page and his/her session ID is transmitted to UserB.
  4. UserB can now use UserA's account until he/she logs out (possibly longer if he/she changes UserA's password).
If UserB had put the code on his own website, it would not be allowed to access the session-cookie. The name "cross site" derives from the way the attack is directed "across" the web-site, from the attacking data source to the attacked browser.

External links

  • http://httpd.apache.org/info/css-security/
  • http://www.cert.org/advisories/CA-2000-02.html
  • XSS FAQ
  • http://www.shocking.com/~rsnake/xss.html
* The CSS Blacklist

 

<< PreviousWord BrowserNext >>
basename
villanova university
rose island
notting hill carnival
bullfinch
pave
pave paws
stonarov
grenadines
dikembe mutombo
quantock hills
university of iowa
north thoresby
alderbury
linus roache
whaddon
secretary of state for international development
valerie amos, baroness amos
michigan state university
nemain
tara, ireland
jihlava
edwin sandys (american colonist)
european bee eater
william roache
subaru
mark ellis (record producer)
bristol rovers f.c.
martin marietta x 24
kuks
david crosby
emmendingen (district)
wilhelm hoegner
weird science
karl carstens
confidence
bavarian forest
regen river
international chamber of commerce
brinkmanship
dna dna hybridisation
jimmy rushing
suffer
requiem shark