1/48
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What is Software Security?
Software security focuses on protecting the environment in which software operates, ensuring it functions correctly under malicious attacks.
What are common sources of software insecurity?
Sources include complexity, incorrect assumptions, poor implementation, lack of secure coding knowledge, unintended interactions, and insufficient security considerations throughout the software lifecycle.
What is a pointer in programming?
A pointer is a variable that holds a memory address and can be used for indirect addressing.
What are the two fundamental operations of pointers?
The two operations are assignment (setting a pointer's value) and dereferencing (accessing the value at the pointer's address).
What is a dangling pointer?
A dangling pointer refers to a pointer that points to a memory location that has been deallocated.
What is memory leakage?
Memory leakage occurs when a program loses access to dynamically allocated memory, making it inaccessible for further use.
What is type checking?
Type checking ensures that the operands of an operator are of compatible types, preventing type errors.
What is the difference between static and dynamic type checking?
Static type checking occurs at compile time, while dynamic type checking occurs at run time.
What is strong typing in programming languages?
Strong typing enforces strict rules on how types can be used and interchanged, enhancing type safety and error prevention.
Which languages are considered strongly typed?
Java and Python are examples of strongly typed languages.
What is type safety?
Type safety ensures that only operations allowed by a data's type are performed, preventing type errors.
Which languages are not considered type safe?
C and C++ are not considered type safe.
What is coercion in type checking?
Coercion is the automatic conversion of one type to another by the compiler to ensure compatibility.
What is the purpose of input validation in software security?
Input validation aims to ensure that inputs to a program are correct and secure, preventing vulnerabilities.
What are buffer overflow attacks?
Buffer overflow attacks occur when a program writes more data to a buffer than it can hold, potentially overwriting adjacent memory.
What is a stack smashing attack?
A stack smashing attack involves overwriting the stack memory of a program to alter its execution flow.
What is the significance of pointers in dynamic memory management?
Pointers allow for dynamic memory allocation and management, enabling programs to use memory more efficiently.
What is the role of type inferencing in programming languages?
Type inferencing allows the compiler to deduce the type of a variable based on its context, reducing the need for explicit type declarations.
What are the implications of weak typing in programming languages?
Weak typing allows for more flexible type conversions, but can lead to unexpected behavior and type errors.
What is the impact of programming errors on software security?
Programming errors are a major source of vulnerabilities, often leading to insecure software.
What is the importance of considering security at all lifecycle stages of software development?
Considering security at all stages helps identify and mitigate vulnerabilities early, improving overall software security.
What is the output of dereferencing a pointer in C?
Dereferencing a pointer retrieves the value stored at the memory address the pointer points to.
What is the effect of pointer arithmetic in C?
Pointer arithmetic allows manipulation of memory addresses, enabling access to different elements in an array.
How can programming languages enforce software security?
Languages can enforce security through strong typing, type safety, and built-in security features.
What is the relationship between type safety and programming errors?
Higher type safety reduces the likelihood of programming errors related to type mismatches.
What is an example of a language with dynamic type checking?
Python is an example of a language that uses dynamic type checking.
What are call stacks used for in programming?
Call stacks are used to store local variables, function parameters, and control flow data during function calls.
What is an activation record?
An activation record is a layout for the required storage of local variables, parameters, dynamic links, and return addresses for a function activation.
What is the purpose of the dynamic link in an activation record?
The dynamic link points to the top of the activation record instance of the caller.
What happens during a function call in a call stack?
The execution status of the caller is saved, parameters are passed, the return address is passed to the callee, and control is transferred to the callee.
How does a buffer overflow occur?
A buffer overflow occurs when an attacker sends more data than a buffer can hold, causing the excess data to overflow into adjacent memory locations.
What are the consequences of a successful stack smashing attack?
A successful attack can lead to unauthorized access, privilege escalation, or the injection of malware by redirecting program flow to malicious code.
What is the role of bounds checking in preventing buffer overflows?
Bounds checking ensures that buffers do not overflow by validating the size of incoming data before copying it into buffers.
What are stack canaries?
Stack canaries are random values placed between the buffer and control data that trigger an alert or terminate the program if modified, indicating a buffer overflow.
What is the purpose of using safe string functions?
Safe string functions allow developers to specify the size of the destination buffer, reducing the risk of buffer overflows.
What does marking the stack region as non-executable do?
Marking the stack region as non-executable prevents injected code from executing on the stack.
What is an example of a recursive function that can cause stack overflow?
The factorial function can cause stack overflow if the recursion depth exceeds the stack size.
What is the significance of the return address in an activation record?
The return address is used to determine where control should return after a function call is completed.
What is the difference between static and dynamic links in a call stack?
Static links are used in languages with nested functions to access outer function stack frames, while dynamic links point to the caller's activation record.
What is the structure of a call stack after a function call?
The call stack contains the activation records of the current function and all functions that have been called, with the most recent call at the top.
How does an attacker manipulate program flow during a buffer overflow attack?
An attacker can overwrite critical control data, such as return addresses, to redirect the program's execution to malicious code.
What is the purpose of address space randomization?
Address space randomization makes it harder for attackers to predict the location of critical data structures, enhancing security.
What is the role of the kernel address space in a program's execution?
The kernel address space is where the operating system's kernel resides and manages system resources during program execution.
What does the term 'stack overflow' refer to?
Stack overflow refers to a condition where the call stack pointer exceeds the stack bound, often due to excessive recursion or allocation.
What is the significance of the return value in a recursive function?
The return value in a recursive function is used to pass the result of the function back to the caller, often combining results from multiple calls.
What is an example of a function that might cause stack overflow due to recursion?
The factorial function is an example, as it calls itself with decremented values until a base case is reached.
What is the purpose of the 'main' function in a C program?
The 'main' function serves as the entry point for program execution in C.
What happens to local variables when a function call is completed?
Local variables are removed from the stack and their memory is reclaimed when the function call is completed.
What is the role of the 'getch()' function in the buffer overflow example?
The 'getch()' function is used to read input into the buffer, which can lead to overflow if the input exceeds the buffer size.