Lecture 8: Web Security Flashcards

1
Q

Explain what an “injection” is, in the context of web security, and how it can be prevented

A
  • When an attacker injects data into a query, e.g. a SQL statement

o Solution: use parameterised queries, or an object-relational mapping

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

Explain what a “Sensitive Data Exposure” is, and how it can be prevented

A
  • 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

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

Explain what a “XML External Entity (XXE)” is, and how it can be prevented

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Explain what a “Broken Access Control” is, and how it can be prevented

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain what “Security Misconfiguration” is, and how it can be prevented

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain what “Cros-Site Scripting” is, and how it can be prevented

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain what “Insecure Deserialisation” is, and how it can be prevented

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Explain what “Insufficient Logging & Monitoring” means, and how it can be prevented

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain what “Cross-Site Request Forgery (CSRF)” is, and how it can be prevented

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain what “Open Redirects” are, and how they can be prevented

A
  • Redirect browser to a site based on data in the URL
  • Useful for phishing attacks
    o Solution: Always verify that the destination is authorized
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Explain what “Clickjacking” is, and how it can be prevented

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly