Lecture3 XSS Flashcards
XSS flaws occur when …
user supplied data included in page sent to browser without properly validating or escaping that content
A page that is vulnerable to Stored XSS will ….
execute the injected script every time the page is loaded by the browser (persistent XSS)
examples: blog posts, comments, registration, edit profile
Stored XSS: Inspecting the source code shows ….
where the data has landed
Stored XSS attacks make use of ….
the improper treatment of dynamic content coming
from a backend data store.
The attacker abuses an editable field by inserting some JavaScript code, which is evaluated in the browser when another user visits that page
Lack of data sanitisation/ filters reflects untrusted data and opens the door to ….
1) Script Injection
2) iFrame phishing
3) Redirection
4) Cookie stealing
5) Identity theft
6) DoS - website vandalism
7) Financial fraud
XSS protection 1
1) Blacklisting (poor protection)
2) Whitelisting
3) html encoding
XSS protection 2
1) Whitelist values drop-down list
2) Content Security Policy
3) Sanitise HTML: use HTML sanitization library to stop script injection
4) HTTP-only cookies: cookies will be received, stored, sent by the browser but cannot be modified by JS
Content Security Policy
the script that’s running on a web page must be stored on a specific web server