Cross-Site Scripting (XSS) Flashcards

1
Q

What is cross-site scripting (XXS)?

A

Cross-Site Scripting is a web security vulnerability that allows attackers to inject malicious scripts into a legitimate website or web application, these malicious scripts are then executed in the browsers of other users who visit the affected site.

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

What kind of scripts are used in XXS?

A

JavaScript and other scripts.

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

What is Stored XXS or Persistent XXS?

A

The malicious script is permanently stored on the target server.

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

Where might you find Stored XXS or Persistent XXS?

A

Database, comments section, or user profiles.

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

What is Reflected XXS?

A

Malicious script is embedded in a URL or input parameter and reflected back to the user in the server’s response.

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

Who is affected by Stored XXS or Persistent XXS?

A

Affects all users who visit the affected page.

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

Where might you find Reflected XXS?

A

The malicious script is embedded in a URL or input parameter.

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

Who is affected by Reflected XXS?

A

Users who interact with the crafted link.

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

What is DOM-Based XSS?

A

The vulnerability is in the client-side JavaScript code, where the malicious payload is processed directly in the browser without involving the server.

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

How does DOM-Based XXS work?

A

A website dynamically updates content based on URL parameters or user input.

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

What is the impact of DOM-Based XXS?

A

Can bypass server-side protections since the attack happens entirely in the browser.

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

What are some XXS targets?

A

Search boxes, forms, URL parameters, and content management systems.

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

What are the impacts of XXS?

A

Data theft, session hijacking, website defacement, malware distribution, and privilege escalation.

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

What is the XXS manual testing script?

A
<script>
alert('XSS')
</script>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you prevent XXS?

A

Sanitize user input (OWASP ESAPI), encode output (HTML encode, JavaScript escape), content security policy (CSP), avoid inline JavaScript, use secure libraries (React, Angular), validate inputs.

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

How do you detect XXS?

A

Manual testing, automated tools (Burp Suite, OWASP ZAP, and Acunetix), and code review.