Security Flashcards

1
Q

What is security?

A

Maintaining desired properties in the presence of adversaries

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

What does the CIA Model stand for?

A

Confidentiality - Info is only disclosed to authorized people
Integrity - Info is modified in allowed ways by authorized parties & do what is expected
Availability - Those authorized for access are not prevented from it

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

What is an example of each issue in CIA?

A

C - information leaks
I - Data Corruption
A - Denial of service
CIA - Remote execution

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

What are some attack vectors in buggy software?

A
XSS
SQL Injection
Buffer Overflow
Path Replacement
Integer Overflow
Race Conditions
Unsanitized Format Strings
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why do security issues slip through despite our testing? What can we do about it?

A

We cannot test everything
Concessions form part of an attack surface

We need additional policies and testing methods specifically for security

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

What are 3 groups of attacks?

A

Insecure Interaction
Risky Resource management
Porous Defenses

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

In regards to unsafe memory, what can a dangling or out of bounds pointer cause?

A

Code corruption due to change in code
Control Flow Hijack due to change in code pointer
Data Only Attack due to change in data
Info Leak by just outputting data

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

How can we prevent code corruption? What problems could this create?

A

Use the NX bit to make something executable not writeable and vice versa.
This could be incompatible with JITs or JavaScript on the web

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

How can we prevent control flow hijacking? What are the issues for these methods?

A

Include a stack canary in your stack. If it is modified, abort immediately. Issue: Hacker could leak canary before hijacking
Data Execution Prevention (DEP). If the injected code is above the return address in the stack, abort execution because it’s writeable, but not executable. Issue: Can be turned off and hijacker can use existing code

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

What is return oriented programming?

A

Build new functionality from pieces of existing functions

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

What is address space layout randomization? Why is it easily broken?

A

Randomizing locations of certain addresses in the stack.

Leaking a single address of libc, for example, means everything in libc can be used

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

What is control flow integrity?

A

Restricting indirect control flow to needed targets. Say it’s valid to only go to certain locations by analysing the source code.
“if this is a function pointer, here are the functions it can point to”
This is a defense analogous to stack canaries

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

Vulnerabilities mostly come from ______, ______, and _______

A

reading, writing, freeing

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

In Java, memory vulnerabilities are not a big issue due to what? However, you can still execute unsafe code since most code today is not written in a single language.

A

Managed memory + bounds checking on pointers

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

What is a SQL injection?

A

Injecting executable SQL when a program prompts you for values that will be put into a table

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

How can we prevent SQL injections?

A

By sanitizing inputs:
Sanitizing APIs
ORMs
Using abstractions that design error away (when you generate code in another language)

17
Q

What is a side channel attack?

A

Inferring secret information about a system based on implementation details

18
Q

In side channel attacks, where can leaks come from?

A
output
timing
power
sound
light
19
Q

Why does the following code expose a side channel attack?

def still_bad(greeting, sensitive):
if sensitive:
log_to_nonsensitive(greeting)

A

The value of the sensitive info can be inferred by the existence of the nonsensitive information

20
Q

Why does the following code expose a side channel attack?

def subtly_bad(greeting, sensitive):
if sensitive:
expensive_computation()
log_to_nonsensitive(greeting)

A

The difference in execution time can be used to infer the existence of sensitive information

21
Q

What was the fundamental premise behind Spectre?

A

Side channel attacks. Specifically, timing the difference in misspeculations

22
Q

What is access control policy?

A

Rules put in place to enforce who can read.write what things

23
Q

What is the difference between discretionary and mandatory access control?

A

Discretionary: Owner determines access
Mandatory: Clearance determines access

24
Q

How can we assure security?

A
  • Make risky operations someone else’s job (google pay, paypal, etc)
  • Define rigorous security policies based on CIA
  • Follow secure design and coding policies and include them in your review criteria
  • Get formal certification
25
Q

What are some proactive approaches to security?

A

Security must be a part of design
Regular security audits
Penetration testing

26
Q

What should someone do when they find a vulnerability?

A
  • Report them to the developer/organization, not to the public immediately
  • Time should be given for the devs to fix an issue, but should also be reported to the public eventually