Web Security Flashcards
1
Q
What is Cross-Site Scripting (XSS) and how does it work?
(5)
What is a subtype of XSS?
A
XSS is a code injection attack that allows attacker to execute malicious JavaScript in another user’s browser.
Attacker doesn’t directly target victim.
Attacker exploits vulnerability in a website that the victim visits.
Website will deliver the malicious JavaScript.
Malicious JavaScript appears to be a legit part of the website.
Can use SQL injection to insert malicious JavaScript code.
Subtype: Self-XSS. Using social engineering, trick users to execute malicious JavaScript to their browser.
2
Q
Name three consequences of Cross-Site Scripting attacks.
A
- Cookie theft
- Key logging, using addEventListener
- Phishing, inserting a fake login form into the page using DOM manipulation
3
Q
What are two methods of preventing XSS?
A
- Encoding = escapes the user input so that the browser only interprets it as data, not as code.
- Validation = filters the user input so that the browser only interprets it as code without malicious commands.