XSS (Reflected) Flashcards
(10 cards)
Q1: What is Reflected XSS?
A1: When malicious input is reflected from the server into the page and executed immediately in the victim’s browser.
Q2: Why does Reflected XSS happen?
A2: Because untrusted input is inserted into the page without validation or escaping, especially in dynamic HTML or JS contexts.
Q3: What’s an example payload for Reflected XSS?
A3:
alert(1)
Q4: What JavaScript sinks are dangerous in Reflected XSS?
A4: document.write(), innerHTML, eval(), setTimeout(), location.href, and inline event handlers.
Q5: Name 3 real-world consequences of Reflected XSS
A5:
1. Stealing session cookies
2. Defacing pages
3. Redirecting to phishing sites
Q6: How can you detect Reflected XSS using Burp Suite?
A6: Inject test payloads like
alert(1)into URL/query parameters and inspect the reflected response or rendered output.
Q7: What are two solid prevention methods?
A7:
- Escape output properly based on context (HTML/JS/URL)
- Use frameworks that auto-sanitize (React, Angular, etc.)
Q8: What’s a good metaphor for remembering Reflected XSS?
A8: Like throwing a boomerang with a knife — and it comes back to stab the user.
Q9: What HTTP request type is most common for Reflected XSS?
A9: GET
Q10: How does CSP help with XSS?
A10: Content Security Policy blocks inline scripts and restricts script sources, mitigating script injection even if the payload lands.