Cross Site Scripting (XSS) Explained [Short Version]

[ Click here for the regular version ]

Many people, including some in the IT and InfoSec fields, lack a decent grasp of Cross Site Scripting (XSS). Here's a summary in a few points.

  1. Websites commonly display user-entered content back to them during as part of their regular functionality.
  2. So, when you search for dogs in a common search engine, you often see something like, "You searched for "dogs"." in your results.
  3. Cross Site Scripting (XSS) is when you can send code to a site and have it get bounced or reflected back to you instead of just text.
  4. Some code, such as Javascript, that gets reflected back to you gets run in your browser.
  5. Attackers get people to run malicious code by creating pre-defined links that contain URLs that send queries to XSS vulnerable sites.
  6. These links include code that, when run, will do things like send the victim's cookies from that site to another place on the Internet.
  7. Attackers then create a ton of these links for sites that they think could yield valuable information (such as banks).
  8. They then send these links out and wait for them to be clicked on.
  9. When a victim clicks the link, they make the query to the vulnerable form (often a search field) that includes the malicious code.
  10. That code is then reflected back to the victim's browser (just like "dog"), and it is then run.
  11. Cookies for a given site can only be read by that site, but because the victim is making the request, and the code that gets reflected back comes from the site that the attacker is targeting, any request to read the victim's cookies will be successful.
  12. The attacker just received your cookies from your bank, or stock trading site, or whatever.
  13. The key concept is that the attacker gets the VICTIM to make a request to a vulnerable site, and the code that gets reflected back is run in the victim's browser.

Top

Popular

Information Security / Technology

Politics

Philosophy & Religion

Technology & Science

Culture & Society

Miscellaneous

Arguments

Projects

Collections

Twitter

What I'm Reading

Favorite Books and Essays

Top Blog Categories

Inputs