xss:about_xss
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
xss:about_xss [2016/10/10 00:37] – peter | xss:about_xss [2020/04/15 08:44] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== XSS - About XSS ====== | ||
- | |||
- | ===== What is XSS? ===== | ||
- | |||
- | Cross-site scripting (XSS) is a code injection attack that allows an attacker to execute malicious JavaScript in another user's browser. | ||
- | |||
- | The attacker does not directly target his victim. | ||
- | |||
- | |||
- | ===== How the malicious JavaScript is injected ===== | ||
- | |||
- | The only way for the attacker to run his malicious JavaScript in the victim' | ||
- | |||
- | In the example below, a simple server-side script is used to display the latest comment on a website: | ||
- | |||
- | <code html> | ||
- | print "< | ||
- | print " | ||
- | print database.latestComment | ||
- | print "</ | ||
- | </ | ||
- | |||
- | The script assumes that a comment consists only of text. However, since the user input is included directly, an attacker could submit this comment: <color red>"< | ||
- | |||
- | <code html> | ||
- | < | ||
- | Latest comment: | ||
- | < | ||
- | </ | ||
- | </ | ||
- | |||
- | When the user's browser loads the page, it will execute whatever JavaScript code is contained inside the < | ||
- | |||
xss/about_xss.1476059873.txt.gz · Last modified: 2020/07/15 09:30 (external edit)