XSS (Reflected) Flashcards

(10 cards)

1
Q

Q1: What is Reflected XSS?

A

A1: When malicious input is reflected from the server into the page and executed immediately in the victim’s browser.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Q2: Why does Reflected XSS happen?

A

A2: Because untrusted input is inserted into the page without validation or escaping, especially in dynamic HTML or JS contexts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Q3: What’s an example payload for Reflected XSS?

A

A3:

alert(1)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Q4: What JavaScript sinks are dangerous in Reflected XSS?

A

A4: document.write(), innerHTML, eval(), setTimeout(), location.href, and inline event handlers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Q5: Name 3 real-world consequences of Reflected XSS

A

A5:
1. Stealing session cookies
2. Defacing pages
3. Redirecting to phishing sites

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Q6: How can you detect Reflected XSS using Burp Suite?

A

A6: Inject test payloads like

alert(1)
into URL/query parameters and inspect the reflected response or rendered output.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Q7: What are two solid prevention methods?

A

A7:

  1. Escape output properly based on context (HTML/JS/URL)
  2. Use frameworks that auto-sanitize (React, Angular, etc.)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Q8: What’s a good metaphor for remembering Reflected XSS?

A

A8: Like throwing a boomerang with a knife — and it comes back to stab the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Q9: What HTTP request type is most common for Reflected XSS?

A

A9: GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Q10: How does CSP help with XSS?

A

A10: Content Security Policy blocks inline scripts and restricts script sources, mitigating script injection even if the payload lands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly