P2L12: Web Security Flashcards

1
Q

What are cookies used for?

A

To store state - specifically user data

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

What threats do cookies have?

A

They can be used as spyware

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

What is Cross Site Scripting?

A

It’s where variables are substituted with malicious bits of code. Cookies can be stolen in this manner to help impersonate the user.

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

How do you defend against XSS?

A

Clean variables and make sure they aren’t scripts

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

What is Cross Site Request Forgery? (XSRF)

A

It’s where malicious code idly sits on a browser and steals cookies from legitimate sites so they can reuse them before they time out to do malicious things.

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

What are the differences between XSS and XSRF?

A
  • In XSS
    • User trusts —> bad implemented website
    • Attacker gets script in trusted website
    • User’s browser executes the script
  • In XSRF
    • Bad implemented website —> trusts user
    • Attacker tricks browser into issuing requests
    • Website executes script
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

In XSS and XSRF where is each script executed?

A

XSS - User’s browser

XSRF - Website

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

In XSS and XSRF who trusts who?

A

XSS - User trusts badly implemented website

XSRF - Badly implemented website trusts user

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

In XSS and XSRF how does the attacker attack?

A

XSS - script is put in trusted website

XSRF - tricks browser to issuing requests

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

How do you prevent SQL injections?

A

Sanitize your variables/data and only allow whitelist of acceptable inputs

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