Lecture4 CSRF Flashcards
CSRF typically used to ..
CREATE, DELETE, UPDATE (or CHANGE)
Both OSRF and CSRF rely on the following:
1) Cookies and HTTP authentication info
2) Web page functions which rely on Cookies and HTTP authentication info known by the web browser
3) Knowledge of valid web app URLS
4) The existence of HTML elements which call
back to server resources.
OSRF vs CRSF
OSRF: Means that an attacker is trying to use something like XSS to create a request on that web page itself i.e. the code that generates the request is posted on the same server as the site that you are looking to fool the authenticated users
CSRF: looking to have a 3rd party website that generates a request for an object or url
- don’t need to know session id or cookie info
Black box testing vs Grey box testing
Black box testing: you don’t know the code behind MyBank.com. You reverse engineer what is going on step by step
Grey box testing: you do have access to some code
What is a nonce?
A one-time key e.g. per-session nonce, per-request nonce
CSRF Mitigation Do’s
- Generate a unique nonce for each form.
2. Same origin policy HTTP header.
CSRF Mitigation Do Not’s
- Secret Cookie
- Accepting only POST Requests
- Multi-Step Transactions
- URL Rewriting
- HTTPS
How to protect yourself from CSRF attacks
- Log out of applications
- Change default passwords
- Different browser for sensitive browsing
- Virtual Machine