Lecture 8: Web Security Flashcards
Explain what an “injection” is, in the context of web security, and how it can be prevented
- When an attacker injects data into a query, e.g. a SQL statement
o Solution: use parameterised queries, or an object-relational mapping
Explain what a “Sensitive Data Exposure” is, and how it can be prevented
- With initial access, an attacker can read sensitive data, e.g. from database or with API access
o Solution: Encrypt data at rest and in transit. Only trusted services can decrypt
Explain what a “XML External Entity (XXE)” is, and how it can be prevented
- XML processors might disclose internal files, allow remote code execution or DOS-attacks
o Solution: Disable XML external entity and DTD processing and upgrade XML parsers. Validate all user inputs
Explain what a “Broken Access Control” is, and how it can be prevented
- Many ways to bypass access control, such as by manipulating things like the URL, request parameters or cookies
- Examples: Guess the admin URL or modify user ID in plaintext cookie
o Solution: Test your code and application
Explain what “Security Misconfiguration” is, and how it can be prevented
- Manual or ad-hoc system configurations commonly create security vulnerabilities
o Solution: System hardening and automation, disable unnecessary features and talkative error messages, check configs
Explain what “Cros-Site Scripting” is, and how it can be prevented
- Inject custom scripts run by target site.
- Reflected to user, stored in server database, or added to page DOM
o Solution: Escape untrusted data based on output context
Explain what “Insecure Deserialisation” is, and how it can be prevented
- Insecure handling of hostile serialized objects can lead to remote code execution, injections and other attacks
o Solution: Don’t de-serialize user provided objects. If you must, sign and check signature before processing, do type checking
Explain what “Insufficient Logging & Monitoring” means, and how it can be prevented
- Long response times allow attackers to maintain persistence, pivot to more systems, tamper, extract or destroy data
o Solution: Establish effective monitoring and alerting for all critical operations
Explain what “Cross-Site Request Forgery (CSRF)” is, and how it can be prevented
- Get users to make unwanted requests to a site they’re authenticated against
- Data sent to site without interaction
o Solution: Use CSRF tokens to prevent
Explain what “Open Redirects” are, and how they can be prevented
- Redirect browser to a site based on data in the URL
- Useful for phishing attacks
o Solution: Always verify that the destination is authorized
Explain what “Clickjacking” is, and how it can be prevented
- Hide another page below what the user sees. Align elements to make user interact with the embedded page
o Solution: Use X-Frame-Options to control if page can be embedded in an iframe