Web security Flashcards
What are the goals of web security
Users should be able to visit a variety of websites without incurring harm. Secure web applications
List the web threat model
- Web attacker: - control attacker.com, then the user visits attacker.com
- Network attacker: - Passive: Wireless eavesdropper -Active: Evil router, DNS Poisoning
- Malware attacker: - Attacker escapes browser isolation mechanisms and runs separately under the control of OS
Examples of Malware attacker
XSS, SQLi, CSRF
What are URLs
Global identifiers of network-retrievable documents
What are cookies
They are used to store state on a user’s machine. HTTP is a stateless protocol, cookies add state
What are cookies used for
- Authentication
- Personalization, recognize the user from a previous visit
- Tracking: follow the user from site to site, learn their browsing behaviour
What is the default scope of a cookie
The domain and path of the setter URL
What are the allowed and disallowed domains of this host “login.site.com”
Allowed: - login.site.com, site.com
Disallowed: - user.site.com, othersite.com, .com
Does secure cookies provide integrity
NO. only confidentiality. Network attacker can re-write secure cookies
How can you achieve data integrity
Cryptographic checksums. use secret key to generate a tag for the cookie
Explain SQL Injection
Browser sends malicious input to server, bad input checking leads to malicious SQL query
Explain CSFR
A Bad website sends browser request to a good web site using the credentials of an innocent victim
Explain XSS
A bad website sends innocent victim a script that steals information from an honest website
What causes injection
When data and code share the same channel
List 2 ways of preventing SQL iNJECTION
- Input validation (Blacklisting or whitelisting(better))
- Escaping quotes: use escaper characters to prevent the quote becoming part of the query. i.e convert ‘ to '