18. Web security: client-side attacks Flashcards

1
Q

What is session hijacking?

A

Exploitation of a valid computer session (to gain unauthorised access)

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

What does CSRF stand for?

A

Cross-site request forgery

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

What is a CSRF attack?

A

Forces a user to execute an unwanted action, targets state-change requests since attacker cant see responce

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

How do you defend against CSRF? (3)

A
  • Check referrer (ensure request comes from original site)
  • Include CSRF token in forms (request becomes unpredictable, can’t be forged)
  • Set SameSite attribute on cookie (prevents cookies being sent in cross-site requests)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the origin

A

The scheme, host and port of a URL

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

What is the same origin policy?

A

SOP restricts access to DOM to scripts loaded from the same origin

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

What does XSS stand for?

A

Cross-site scripting

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

What is an XSS attack?

A

Malicious scripts are injected into a trusted web site

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

What are the two types of XSS attack?

A
  • Stored

- Reflected

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

What is a stored XSS attack?

A

Injected script permanently stored on target server (database, forum message, etc)

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

What is a reflected XSS attack?

A

Injected script is reflected off the web server (error message, search result, other response containing user input)

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

How do you defend against XSS?

A
  • Escape/filter output
  • Validate input
  • CSP, server whitelists scripts that can appear on page
How well did you know this?
1
Not at all
2
3
4
5
Perfectly