Info Scurity Priv

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/295

encourage image

There's no tags or description

Looks like no tags are added yet.

296 Terms

1
New cards

Security (definition)

Protecting assets from threats posed by adversaries; systems contain assets, adversaries want them, and they use attack surfaces to interact with the system.

2
New cards

Asset

What we are trying to protect (user data, systems/functionality, availability, physical resources). Not all assets are equally valuable (e.g., passwords > usernames, payment data > UI preferences).

3
New cards

Threat

A potential source of harm / what could go wrong (data theft, unauthorized access, service disruption, data manipulation).

4
New cards

Vulnerability

A weakness in a system.

5
New cards

Attack

Exploiting a vulnerability to realize a threat. Chain: threat -> vulnerability -> attack -> impact.

6
New cards

Adversary types

Casual attackers (script kiddies), cybercriminals, insiders, nation-state actors. They have different capabilities and goals.

7
New cards

Attack surface

Everywhere an attacker can interact with the system: login forms, APIs, network interfaces, user input fields. In threat modeling it = entry points for threats; every attack surface is a place to look for threats.

8
New cards

CIA triad

The core security goals: Confidentiality, Integrity, Availability.

9
New cards

Confidentiality

Only those who should have access do. Violations: exposed personal data, password leaks.

10
New cards

Integrity

Only those who should be able to change data/systems can. Violations: changing grades, modifying transactions.

11
New cards

Availability

The system remains available and usable when legitimate users need it. Violations: website outages, denial of service, ransomware.

12
New cards

A university website is down during registration. Which CIA property is hit?

Availability.

13
New cards

Equifax breach: summary and CIA impact

~147 million people's data (SSNs, birth dates, addresses) exposed. Attackers exploited an unpatched web app vulnerability (input handling). Asset: sensitive personal data. Impact: Confidentiality.

14
New cards

Colonial Pipeline attack: summary and CIA impact

Ransomware shut down a major US fuel pipeline for several days, causing fuel shortages. Asset: operational systems. Impact: Availability.

15
New cards

Risk formula

Risk = Likelihood x Impact.

16
New cards

What affects likelihood?

Known vulnerabilities, mitigation strategies in place, and difficulty to exploit.

17
New cards

What affects impact?

Financial cost, business operations, and users (harm to people).

18
New cards

Three ways to get risk to a manageable level

Reduce likelihood, reduce impact, or accept the risk.

19
New cards

Security tradeoffs

Security vs functionality, usability, performance, and cost. Security is about tradeoffs, not absolutes.

20
New cards

Why does security fail in the real world?

Complexity, human error, poor assumptions, misaligned incentives, and overtrust in tools.

21
New cards

Most vulnerabilities are… (secure dev mindset)

Not advanced zero-days. Common sources: missing input validation, incorrect assumptions about users, overly complex systems, misconfigured systems.

22
New cards

Threat modeling (definition)

A structured way to identify threats, understand risk, and design defenses; ideally done early in system design. Helps prioritize risks; many failures are predictable.

23
New cards

Five steps of the threat modeling process

1) Understand the system 2) Identify assets 3) Identify threats 4) Evaluate risk 5) Design mitigations.

24
New cards

Step 1: understanding the system - what do you identify?

Components (app, backend, DB, devices), data flows, and external dependencies (APIs, third parties). "You can't secure what you don't understand." Focus on how the system actually operates, not how it's supposed to.

25
New cards

Step 1 key questions

Who uses the system? What are the main features? Where does data enter and leave? What are the trust boundaries?

26
New cards

How do you prioritize assets?

Ask what attackers would want most and what would cause the most harm if compromised. Prioritization focuses effort.

27
New cards

STRIDE (what it is)

A threat modeling framework where each letter is a way a system can fail; it is a prompting tool: pick a component and ask what each category would look like there, then write down concrete threats.

28
New cards

STRIDE: Spoofing

Pretending to be someone else.

29
New cards

STRIDE: Tampering

Modifying data or systems.

30
New cards

STRIDE: Repudiation

Denying actions (claiming you didn't do something).

31
New cards

STRIDE: Information disclosure

Exposing data.

32
New cards

STRIDE: Denial of service

Making systems unavailable.

33
New cards

STRIDE: Elevation of privilege

Gaining more access than allowed.

34
New cards

Map: data theft / unauthorized changes / service disruption to CIA

Data theft -> confidentiality; unauthorized changes -> integrity; service disruption -> availability.

35
New cards

Other threat modeling frameworks besides STRIDE

Risk-based frameworks (prioritize by impact) and privacy-focused frameworks (data collection, tracking, consent: what is collected, who can access it, how long it is stored). There is no single correct framework.

36
New cards

Risk-based thinking in threat modeling

After finding threats ask: how likely is it? What is the impact? Prioritize what matters; don't try to fix everything; focus on high-risk threats first.

37
New cards

Good mitigations are…

Specific, practical, and tied to a threat.

38
New cards

Key ideas of threat modeling

It maps attack surfaces to possible threats; more features = larger attack surface; more complexity = more risk; it is iterative.

39
New cards

Smart home example: attack surfaces

Mobile app, backend API, IoT devices, network connections.

40
New cards

Defense in depth

Use multiple, redundant defenses and assume some will fail, so one failure doesn't break everything. Layers reduce risk; no single defense is perfect.

41
New cards

Defense in depth example: logins

Input validation, authentication, rate limiting, logging and monitoring.

42
New cards

Security vs usability (human factors)

Stronger security can reduce usability; users reuse passwords, ignore warnings, and bypass controls. Humans are part of the system, and security failures often involve both technical and human factors.

43
New cards

Automation bias

Overtrust in automated tools (e.g., blindly accepting AI suggestions, ignoring system warnings). Tools aren't perfect and AI can introduce vulnerabilities, so developers must verify, question, and think critically.

44
New cards

Secure development mindset

Assume attackers will interact with your system (unexpected input, bypassing checks, edge cases). Ask "how will someone abuse this?" in design, implementation, and testing.

45
New cards

Secure SDLC phases

Requirements, design, implementation, testing, deployment (and maintenance). Security is integrated throughout.

46
New cards

Why is security a design problem?

Many issues originate in architecture and feature decisions; code cannot fix a bad design.

47
New cards

Abuse case

Like a use case but describes how the system can be misused. Example: use case = upload a profile picture; abuse cases = upload a malicious file or an extremely large file. Ask "what could go wrong here?"

48
New cards

Principle of least privilege (secure design)

Give users/components only the access they need; limits damage if compromised (e.g., user shouldn't be admin; service only accesses required data).

49
New cards

Fail securely

Systems will fail, so plan to fail in a way that reduces risk (e.g., an error should not expose sensitive information).

50
New cards

Key secure design ideas

Assume adversarial behavior; design for misuse, not just use; reduce trust in inputs and users; limit damage when things go wrong; security is a way of thinking.

51
New cards

OWASP Secure Coding Guidelines

A practical developer checklist focused on common vulnerabilities and prevention techniques; bridges theory and practice. There is no universal secure code recipe (context: language, system type).

52
New cards

Code review (what and limits)

Manual inspection of code, ideally by someone other than the author, to catch bugs/vulnerabilities. It is imperfect: reviewers miss context-dependent and multi-file vulnerabilities, find simple bugs more than complex ones, and more experience did not mean better detection.

53
New cards

Static analysis: definition, pros, cons

Analyzes code without running it. Pros: scalable, finds known issues. Cons: false positives, limited coverage, may miss context-dependent issues.

54
New cards

Dynamic analysis: definition, pros, cons

Tests the running system. Pros: realistic behavior, finds runtime issues. Cons: complex setup, resource intensive, incomplete coverage.

55
New cards

AI-assisted security tools: risks and benefits

Use ML/LLMs to detect vulnerabilities and suggest fixes. Fast and scalable, but can generate insecure fixes/vulnerabilities with confidence. Useful as a first pass but requires serious verification.

56
New cards

Why developers don't use security tools

Complex setup, hard-to-interpret output, too many false positives, organizational barriers. Tools are not automatic security.

57
New cards

Vulnerability management / routine testing

Organizations track many systems and vulnerabilities: identify, prioritize, fix. Uses vulnerability scanners, mailing lists, API/dependency notifications. Software supply chain is an increasing problem.

58
New cards

Types of vulnerability databases

Commercial (companies sell scanning software and notify orgs), public (crowdsourced), and government (managed by agencies).

59
New cards

CVE

Common Vulnerabilities and Exposures: catalog that identifies, defines, and catalogs publicly disclosed vulnerabilities. Operated by MITRE on behalf of DHS. A CNA assigns/publishes the CVE ID.

60
New cards

CVSS

Common Vulnerability Scoring System: a measure of severity used to prioritize which vulnerabilities to fix first.

61
New cards

NVD

National Vulnerability Database: repository of standard vulnerability data that receives CVEs and enriches them (CVSS scores, impact metrics, product names) to enable automation of vulnerability management.

62
New cards

Process memory layout (high to low)

Kernel, stack (local vars and function control data), free space, heap (global vars, dynamically allocated memory), program code.

63
New cards

Stack frame contents

Local variables, arguments, saved registers, plus the old EBP (base of previous frame) and the return address (Return IP).

64
New cards

Why do return addresses matter?

The return address determines where the program executes next; corrupting it lets an attacker redirect execution flow.

65
New cards

Buffer overflow (definition)

Writing beyond the limits of a fixed-size buffer, overwriting adjacent memory.

66
New cards

Why are buffer overflows dangerous?

They can corrupt program data, crash the program, or give arbitrary code execution (by overwriting the return address/control data).

67
New cards

What causes buffer overflows?

Unsafe functions (strcpy, gets), no automatic bounds checking in C, which puts validation on the developer; assumptions about input size.

68
New cards

How do attackers exploit buffer overflows?

Overwrite the return address or other control data to redirect execution to injected code or to existing code.

69
New cards

Return-to-libc attack

Instead of injecting malicious code, reuse code already in memory (standard libraries/system functions), e.g., system("/bin/sh").

70
New cards

Use-after-free

Accessing memory after it was freed. The memory may be reused by something else, so reads/writes via the dangling pointer hit another object: unpredictable behavior, crashes, or exploitation.

71
New cards

Mitigation for use-after-free

Set pointers to NULL after free and check for NULL before use.

72
New cards

Double free

Freeing the same memory twice; can cause crashes and heap corruption because the memory manager gets confused and allocations can overlap/overwrite each other.

73
New cards

Integer overflow

Integers have a limited range (depends on language/architecture), and values wrap around at the end of the range.

74
New cards

Uninitialized variables

Using a variable without initializing it takes whatever junk was left in memory: undefined, hard-to-reproduce behavior, crashes, information leakage/manipulation.

75
New cards

Out-of-bounds access

Buffer overflow is an out-of-bounds write; you can also read out of bounds (info leak).

76
New cards

Heartbleed

Famous OpenSSL out-of-bounds read vulnerability that leaked passwords, encryption keys, and other sensitive memory.

77
New cards

Code: char *buf = malloc(8); free(buf); printf("%s", buf); What's wrong?

Use-after-free: reading freed memory. Dangerous because the memory may have been reused (leaks/corrupts data, undefined behavior). Fix: set buf = NULL after free and check it.

78
New cards

Four categories of memory-safety defenses

Secure development practices, safe functions, runtime defenses, memory-safe languages.

79
New cards

Secure development practices for memory safety

Validate input sizes, check bounds carefully, avoid unsafe assumptions.

80
New cards

Safe vs unsafe C functions

gets/strcpy have no bounds checking and assume input fits the buffer. fgets/strncpy require a size from the developer and copy only up to that size.

81
New cards

Stack canary

A random value placed on the stack before the return address; checked before returning to detect stack corruption.

82
New cards

ASLR

Address Space Layout Randomization: randomizes locations of memory regions (stack, heap, etc.) so attackers can't predict addresses; wrong guesses crash the program.

83
New cards

Non-executable memory (NX)

Marks regions like stack/heap as read/write only (not executable), preventing attackers from running code they placed there.

84
New cards

Runtime defenses purpose

Stack canaries, ASLR, and non-executable memory make buffer overflow exploitation harder (not impossible).

85
New cards

Memory-safe languages

Garbage-collected languages avoid these problems but are heavy and can't replace C everywhere. Rust is not garbage collected but enforces memory safety rules at compile time.

86
New cards

Injection attack (core idea)

Software treats data as instructions: the app expects data, the attacker supplies instructions, and the interpreter can't tell developer commands from attacker commands.

87
New cards

Most important rule of input

Never trust input. Everything outside your application is untrusted.

88
New cards

Sources of untrusted input

Users (forms), web traffic (URLs, cookies, HTTP headers, network packets), files, databases, APIs, environment variables, AI-generated content.

89
New cards

Memory safety vs injection: what is trusted?

Memory safety bugs trust input size/memory boundaries; injection trusts that user input is only data.

90
New cards

Input validation: what do we validate?

Length, type, format, range, characters. Define expectations early, be specific, and think about how input could be abused. (e.g., age = integer 0-120, zip = 5 digits.)

91
New cards

Why is validation necessary but not sufficient?

We might forget it, it may have bugs, or miss an edge case. It improves reliability, reduces attack surface, prevents errors, enforces business rules, but is NOT a substitute for separating code from data.

92
New cards

SQL injection (how it works)

App builds a query by concatenating user input into SQL (e.g., "… WHERE username = '" + username + "'"). Input like ' OR 1=1 changes the query logic so the attacker's input is executed as SQL.

93
New cards

What can an attacker do with SQL injection?

Bypass authentication, read sensitive info (password hashes, financial records, PII), modify data (balances, grades), delete data. Impact depends on DB permissions.

94
New cards

Injection family: interpreter and attacker goal

SQL (DB) -> SQL code; OS command -> shell commands; LDAP -> LDAP filters; XPath/XML -> XPath expressions; NoSQL; template engine -> template code (server-side code execution); AI system -> new instructions (prompt injection). Same mistake: untrusted input changes the meaning of an instruction.

95
New cards

Command injection

App passes user input into an OS command (e.g., "ping " + userInput) and attacker supplies shell commands. Impact: execute OS commands.

96
New cards

LDAP injection impact

Bypass authentication (attacker manipulates LDAP queries/filters).

97
New cards

Template injection impact

Execute server-side code.

98
New cards

AI prompt injection

AI apps combine info from multiple sources into one prompt; an attacker places instructions in user input or retrieved content to influence the model (e.g., "ignore all previous instructions…").

99
New cards

Primary defense against injection

Separate code from data so the interpreter knows which is which: prepared statements/parameterized queries for SQL; command APIs with separate arguments for OS commands. Good design makes it impossible for input to change instructions.

100
New cards

Safe APIs: avoid vs prefer

Avoid SQL built with strings, shell commands from strings, manual escaping, writing your own security logic. Prefer prepared/parameterized queries, APIs that pass arguments separately, framework parameter binding/encoding, well-tested library functions.