Security Flashcards
What is a DDoS attack?
Distributed Denial of Service attack
A DoS attack where the traffic flooding the target system comes from many different sources making it much harder to defend against
What is a DoS attack?
Denial of Service attack
Attack where a malicious user tries to bring down or damage a system in order to render it unavailable to users, often by flooding the target system
What is XSS and how does it occur?
Cross-Site Scripting
A security vulnerability typically found in web apps
Occurs when an app takes untrusted data and sends it without proper validation/escaping
Allows attackers to execute scripts in the victim’s browser which can access any cookies, session tokens or redirect users to malicious sites
What are some ways to prevent XSS?
- Sanitise and validate all input
- Add CSP
- Add middleware to enable HTTPOnly flag on cookies to ensure cookies can’t be accessed and can’t be stolen by attackers whose XSS does get through
- Encode output for correct context - encode characters (ie. < or >) to prevent JS from running in that context when putting untrusted data in HTML tag
- Encode both client and server side so app can mitigate DOM-based XSS as well
What is the role of SSL certificates?
SSL certificates are what clients and web servers use to prove that a site is who they say they are and then setting up a secure communication channel
What is salt?
Unique data (ie. timestamp) added to a hash to prevent hash collisions
What are some of the top vulnerabilities in modern web?
- XSS
- SQL injection
- Sensitive data exposure
- Broken authentication and broken access controls
What is a hashing collision? Provide example
Where different inputs generate the same hash
To combat this, we can add salt to the hashes
ie. when two users use the same password
What does encryption and decryption mean?
Encryption
Turning readable data into unreadable data
Decryption
Turning unreadable data into readable data
What is the difference between hashing and encryption?
Hashing is unable to be reversed into its unhashed form
Encryption keeps data secure but recoverable
What is CSP?
Content Security Policy
Browser-side mechanism to allow developers to whitelist client side resources (ie. JavaScript, CSS, images)
Applied via a special HTTP header that instructs the browser to only execute/render resources from the whitelist
How does injection occur and what types are there?
Injection occurs when untrusted data is sent to an interpreter as part of a command or query
Types:
- SQL injection
- JavaScript injection
- Command injection
What are some authentication handshake strategies?
- Key-based authentication
- OAuth
- SSO
How does key-based authentication work?
Uses a username and password but comes with the burden of having to keep these details secure
How does OAuth work?
Website requests authentication from a third-party service then the logged in user verifies that they would like to share details with the new site
Used by Facebook, Google, Twitter