Web Security Flashcards

1
Q

Daemons: Threats

A
  • Daemons are long running:
    -> ASLR/stack canaries are probabilistic, single secret per process/thread
    -> Heap layout influenced by concurrent allocations
    -> Information leaks become more dangerous
  • Daemons are complex:
    -> Crashing threads are restarted: resilience/uptime versus security
    -> Large set of functionalities increases attack surfaces
    -> Shared secrets across users in single address space
  • Daemons are exposed:
    -> Services concurrent users (in the same address space)
    -> Outside connections are allowed
    -> Attackers can leverage many diverse IPs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Protecting daemons/services

A
  • Daemon compartmentalization:
    -> Break complexity into smaller compartments
    -> Develop “fault compartments”, can fail independently
    -> Goal: once component fails, others continue to function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

OWASP Top 10

A
  1. Broken Access Control
  2. Cryptographic Failures
  3. (Code) Injection
  4. Insecure Design
  5. Security Misconfiguration
  6. Vulnerable and outdated components
  7. Identification and authentication failures
  8. Software and data integrity failures
  9. Security Logging and Monitoring Failures
  10. Server Side Request Forgery
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Broken Access Control

A
  • Restrictions on what authenticated users are allowed to do are often not properly enforced
  • Attackers gain access to unauthorized functionality and/or data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Broken Access Control: Protection

A
  • Except for public resources deny access by default
  • Limit exposure (reduce log information to error code)
  • Disable directory listing
  • Rely on central access control
  • Rate limit API calls and enforce access checks
  • Log access control failures (and check the logs!)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Cryptographic Failures

A
  • Sensitive data is not protected well enough
  • Attackers may steal or modify it
  • Goals:
    -> Store and process the minimum amount of sensitive data
    -> Separate and segregate data into compartments
    -> Create data policies that record where, how, and what data is processed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Cryptographic Failures: Protection

A
  • Be aware of what data types are handled (threat modeling)
  • Only store what you need, nothing more
  • Protect data at rest and in transit (e.g. through encryption)
  • Only store password hashes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Code Injection

A
  • Untrusted data is sent to an interpreter as part of a command or query
  • Allows for execution of unintended commands or accessing data without proper authorization
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Code injection: Protection

A

1) Validation
- Ensure that filename matches a set of allowed filenames
- Non-alphanumeric characters are needed to execute commands
- Hardcode directory and set of allowed files
- Disallow special characters in the file name
2) Escaping
- Escape parameters so that interpreter can distinguish between data and control
3) Reduction of privileges

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

Cross-Site Scripting: Protection

A
  • Modern frameworks allow you to properly escape input. Each framework has its subtleties
  • Use the provided escape functionality and review the code
  • Leverage data-flow to detect where unfiltered input exists
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Insecure design

A
  • Lack of threat modeling
  • Lack of focus on secure design patterns and principles
  • Fuzzy “catch all” area that covers any abstract issues
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Security Misconfiguration

A
  • Insecure default configurations
  • Incomplete or ad how configurations
  • Open cloud storage
  • Misconfigured HTTP headers
  • Error messages containing sensitive information
  • All components must be patched and upgraded in a timely fashion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Security Misconfiguration: Protection

A
  • Configuration documentation (what software is in use, in what configuration?)
  • Keep your systems up to date
  • Use compartmentalization
  • Review for configuration failures
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Vulnerable and Outdated Components: Protection

A
  • Remove unused dependencies
  • Documentation of components and dependencies
  • Monitor for unmaintained libraries or components
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Identification and Authentication Failures

A
  • Application function related to authentication and session management are often implemented incorrectly
17
Q

Identification and Authentication Failures: Protection

A
  • MFA
  • Never use default credentials
  • Develop a reasonable password policy
  • Limit or delay failed login attempts
  • Log any login failures
  • Test registration, credential recovery, and API usage against attacks
  • Rate limit failed login attempts
  • Use a server-side secure session manager and only send a random session ID to the user
18
Q

Software and Data Integrity Failures

A
  • Insecure deserialization
    -> Can lead to remote code execution, replay attacks, injection attacks, privilege escalation attacks
19
Q

Software and Data Integrity Failures: Protection

A
  • Integrity check (MAC) messages
  • Enforce type checks during deserialization
  • Isolate parsing code to deprivileged process
  • Log deserialization exception
20
Q

Server Side Request Forgery

A
  • Trick a server to open a request towards the internal network