1. Home
  2. Explore
  3. Computer Science
  4. Building Secure Systems

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Building Secure Systems

  • 72Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Security Foundations

Which description best captures the general goal of security?

72 questions

  1. 1

    Which description best captures the general goal of security?

    1. A

      Preventing every possible user from making mistakes while using a system

    2. B

      Making computer systems impossible to change after they are deployed

    3. C

      Achieving a system's goal even when an adversary is trying to prevent it

    4. D

      Ensuring that software behaves correctly only when no attacker is present

    Correct answer
    C

    Achieving a system's goal even when an adversary is trying to prevent it

    Explanation

    Security concerns achieving desired goals despite an adversary's attempts to interfere, steal data, or disrupt service.

  2. 2

    In a security design, what does a policy specify?

    1. A

      The known defects that remain after the system is deployed

    2. B

      The specific hardware and software used to build the system

    3. C

      The capabilities the adversary is assumed to possess

    4. D

      The goal or rules the system is intended to enforce

    Correct answer
    D

    The goal or rules the system is intended to enforce

    Explanation

    A policy states what the system should permit or protect, such as who may read or modify a file.

  3. 3

    What is a threat model?

    1. A

      A set of assumptions about the adversary and its capabilities

    2. B

      A guarantee that the system will resist every possible attack

    3. C

      A description of how the system's software is organized

    4. D

      A list of all the system's users and their intended permissions

    Correct answer
    A

    A set of assumptions about the adversary and its capabilities

    Explanation

    A threat model defines assumptions about what an adversary can do, such as whether it can access a device physically.

  4. 4

    What role does a security mechanism play?

    1. A

      It defines the adversary's goals and limits its capabilities

    2. B

      It proves that the system cannot contain implementation bugs

    3. C

      It determines which security goals are worth pursuing

    4. D

      It attempts to enforce the policy under the threat-model assumptions

    Correct answer
    D

    It attempts to enforce the policy under the threat-model assumptions

    Explanation

    Mechanisms are the software, hardware, and design components intended to enforce a system's policy.

  5. 5

    Which example most directly illustrates a confidentiality policy?

    1. A

      Only course staff may change the grades file

    2. B

      The grades file is copied to a backup every evening

    3. C

      The grades website remains online during a traffic flood

    4. D

      Only course staff may read the grades file

    Correct answer
    D

    Only course staff may read the grades file

    Explanation

    Confidentiality restricts who can access or read information.

  6. 6

    Which example most directly illustrates an integrity policy?

    1. A

      Only course staff may read the grades file

    2. B

      Only course staff may modify the grades file

    3. C

      The grades website stays reachable during an attack

    4. D

      Students receive a copy of the grades file

    Correct answer
    B

    Only course staff may modify the grades file

    Explanation

    Integrity concerns preventing unauthorized modification of data or system state.

  7. 7

    Which goal is primarily about availability?

    1. A

      Ensuring that users choose memorable passwords

    2. B

      Keeping a website usable despite an attempt to take it offline

    3. C

      Preventing unauthorized users from changing stored grades

    4. D

      Preventing unauthorized readers from viewing stored grades

    Correct answer
    B

    Keeping a website usable despite an attempt to take it offline

    Explanation

    Availability means that a service remains accessible, including when an adversary attempts a denial-of-service attack.

  8. 8

    Why is security often described as a negative goal?

    1. A

      A system can be secure only if it provides no services to users

    2. B

      A system only needs to demonstrate that an authorized user can succeed

    3. C

      A system must prevent every unauthorized way of violating its policy

    4. D

      A system must avoid using positive instructions in its implementation

    Correct answer
    C

    A system must prevent every unauthorized way of violating its policy

    Explanation

    Showing that authorized users can perform an action is relatively easy; security also requires ruling out unauthorized ways to do it.

  9. 9

    Why is it generally harder to establish that only authorized people can read a file than to show that authorized people can read it?

    1. A

      Authorized users cannot test whether they are able to read the file

    2. B

      The system must account for many possible ways unauthorized people might gain access

    3. C

      Reading a file necessarily changes its contents

    4. D

      File permissions apply only to users who are not authorized

    Correct answer
    B

    The system must account for many possible ways unauthorized people might gain access

    Explanation

    Proving authorized access works requires a successful test; preventing all unauthorized access requires considering many possible attacks.

  10. 10

    Why should threat-model assumptions generally be chosen conservatively?

    1. A

      Conservative assumptions guarantee that the mechanism has no bugs

    2. B

      Adversaries are normally unable to adapt to changes in a system

    3. C

      An adversary may have more capabilities in practice than designers expect

    4. D

      A conservative threat model removes the need to state a security policy

    Correct answer
    C

    An adversary may have more capabilities in practice than designers expect

    Explanation

    Erring on the side of caution helps avoid relying on assumptions that an attacker can readily violate.

  11. 11

    What is a useful result of deliberately testing a system's breaking points?

    1. A

      It helps reveal the conditions under which the design is or is not suitable

    2. B

      It proves that every system can be made secure against every adversary

    3. C

      It eliminates the need to revise the system after deployment

    4. D

      It shows that any system with a weakness is entirely worthless

    Correct answer
    A

    It helps reveal the conditions under which the design is or is not suitable

    Explanation

    Finding weaknesses clarifies a system's limits and helps determine when its design is appropriate; a breaking point does not make it useless in every context.

  12. 12

    How can adding account-recovery questions change an account's security policy?

    1. A

      Recovery questions replace the need to authenticate any account user

    2. B

      Access is granted only when both the password and recovery answers are known

    3. C

      Access may be granted by either the password or the recovery answers

    4. D

      Access becomes restricted to users who have physical access to the server

    Correct answer
    C

    Access may be granted by either the password or the recovery answers

    Explanation

    If either a password or recovery answers allow login, the policy permits an additional route to account access.

  13. 13

    Why can account-recovery questions weaken security even if the password itself remains unchanged?

    1. A

      They cause the account's stored data to become publicly readable

    2. B

      They automatically make the original password easier to guess

    3. C

      They create another way for an attacker to satisfy the access policy

    4. D

      They prevent the system from using any other authentication method

    Correct answer
    C

    They create another way for an attacker to satisfy the access policy

    Explanation

    A recovery method can provide an alternate path into an account, so the password is no longer the only credential an attacker would need to defeat.

  14. 14

    What made publicly available personal details dangerous as answers to account-recovery questions?

    1. A

      The answers could be used to prevent the legitimate user from logging in

    2. B

      The details could be used only after the attacker already knew the password

    3. C

      Public details automatically changed the account's saved password

    4. D

      An attacker could look up the answers and use them to regain account access

    Correct answer
    D

    An attacker could look up the answers and use them to regain account access

    Explanation

    Questions about details such as a school or birthday provide little protection when those answers are publicly discoverable.

  15. 15

    In the account-compromise chain involving multiple online services, what general weakness allowed individually reasonable features to combine into an attack?

    1. A

      The services' recovery and account-management procedures interacted in unsafe ways

    2. B

      The attacker bypassed all account-recovery procedures by disabling them

    3. C

      The services shared a single password database that was publicly readable

    4. D

      Each service required an attacker to know every victim password in advance

    Correct answer
    A

    The services' recovery and account-management procedures interacted in unsafe ways

    Explanation

    The attack depended on chaining features across services: information or access obtained at one service helped satisfy another service's recovery process.

  16. 16

    In the described cross-service attack, what did Amazon's ability to add a new payment card help an attacker do?

    1. A

      Reset the victim's email password directly without using another service

    2. B

      Use the added card as a credential in Amazon's password-reset process

    3. C

      Read the victim's full saved card numbers without account access

    4. D

      Bypass all account authentication by purchasing an item

    Correct answer
    B

    Use the added card as a credential in Amazon's password-reset process

    Explanation

    The attacker could add a card and then use a card number associated with the account to satisfy Amazon's reset procedure.

  17. 17

    Why could revealing only the last four digits of a saved payment card still matter in the cross-service attack?

    1. A

      Those digits could supply information needed to recover access to another linked account

    2. B

      Those digits allowed the attacker to reconstruct the entire card number

    3. C

      Those digits automatically authorized purchases from every linked service

    4. D

      Those digits replaced the victim's password on all online accounts

    Correct answer
    A

    Those digits could supply information needed to recover access to another linked account

    Explanation

    Even limited account information can become useful when it supplies a required detail in another service's recovery process.

  18. 18

    What is the main lesson of the multi-service account-compromise example?

    1. A

      A service is secure whenever each individual feature seems reasonable

    2. B

      An attacker can compromise linked services only by guessing every password

    3. C

      Account recovery is safe whenever it uses more than one website

    4. D

      Security must be considered across interacting systems, not only within each one

    Correct answer
    D

    Security must be considered across interacting systems, not only within each one

    Explanation

    A chain of individually plausible features can create a vulnerability when the systems interact.

  19. 19

    Which policy change would most directly reduce the risk from weak recovery questions?

    1. A

      Avoid treating easily discovered personal facts as sufficient proof of identity

    2. B

      Allow more recovery attempts so legitimate users can try more answers

    3. C

      Make recovery answers interchangeable with any user's password

    4. D

      Publish the accepted recovery answers so users can check their accounts

    Correct answer
    A

    Avoid treating easily discovered personal facts as sufficient proof of identity

    Explanation

    Recovery answers should not grant access based on information an attacker can readily discover.

  20. 20

    Which assumption about users is especially risky in a threat model?

    1. A

      Users may sometimes forget a password and need a recovery process

    2. B

      Users may sometimes make mistakes while navigating an interface

    3. C

      Users will always choose strong passwords and avoid deceptive links

    4. D

      Users may need to access a service from more than one device

    Correct answer
    C

    Users will always choose strong passwords and avoid deceptive links

    Explanation

    People often choose predictable passwords, click misleading links, or enter credentials on fake sites, so a system should not rely on perfect user behavior.

  21. 21

    Why should a system designer consider human behavior when defining a threat model?

    1. A

      Users may act in ways that violate assumptions about careful and secure behavior

    2. B

      A threat model applies only to machines, not to people

    3. C

      Human behavior determines whether the system contains any software

    4. D

      Users can always detect whether a website is malicious

    Correct answer
    A

    Users may act in ways that violate assumptions about careful and secure behavior

    Explanation

    A system's security can fail if it assumes users will always make ideal choices, such as selecting strong passwords or recognizing phishing.

  22. 22

    Why can a threat-model assumption that was reasonable when a system was designed become unsafe later?

    1. A

      Threat models are valid only for systems with a single user

    2. B

      Software mechanisms stop operating as soon as their designers leave

    3. C

      Policies automatically become weaker whenever a system is widely used

    4. D

      Technology and adversary capabilities can change over time

    Correct answer
    D

    Technology and adversary capabilities can change over time

    Explanation

    Changes in computing power and attacker capabilities can invalidate assumptions that once seemed plausible.

  23. 23

    Why did a 565656-bit DES key become a weaker protection over time?

    1. A

      Increasing computing power made it feasible to search the key space

    2. B

      The key length grew automatically as computers became faster

    3. C

      DES keys stopped being used for encryption after the 1980s

    4. D

      The algorithm required users to publish their secret keys

    Correct answer
    A

    Increasing computing power made it feasible to search the key space

    Explanation

    An exhaustive search of the 2562^{56}256 possible keys became practical as computers and specialized hardware grew more powerful.

  24. 24

    What does the DES example demonstrate about long-lived security systems?

    1. A

      Their assumptions should be revisited as technology and attack costs change

    2. B

      A key size that once seemed plausible remains secure indefinitely

    3. C

      A widely used system cannot be weakened by advances in computing

    4. D

      Cryptographic assumptions matter only when a system is first installed

    Correct answer
    A

    Their assumptions should be revisited as technology and attack costs change

    Explanation

    Security assumptions can become outdated, so systems need reassessment as adversary capabilities change.

  25. 25

    How can the appropriate threat model differ depending on whom a system is intended to resist?

    1. A

      Protecting against government hardware access may demand stronger assumptions than protecting against casual local snooping

    2. B

      Protecting against casual snooping always requires more than protecting against a government

    3. C

      A threat model is independent of the adversary's resources and goals

    4. D

      A system can use the same assumptions only if every adversary has equal capabilities

    Correct answer
    A

    Protecting against government hardware access may demand stronger assumptions than protecting against casual local snooping

    Explanation

    Threat models depend on the adversary. A powerful attacker with possible physical or hardware access presents a different challenge from a casual snooper.

  26. 26

    What is the risk of assuming that a computer's hardware cannot be compromised?

    1. A

      The assumption would make physical access impossible to detect

    2. B

      A hardware back door could undermine protections installed in software

    3. C

      Software protections would become unnecessary for all users

    4. D

      The computer would be unable to execute any cryptographic operation

    Correct answer
    B

    A hardware back door could undermine protections installed in software

    Explanation

    If an adversary can tamper with hardware, protections implemented only in software may not be sufficient.

  27. 27

    Why is trusting every certificate authority a risky assumption in web security?

    1. A

      A certificate authority controls only its own organization's domain

    2. B

      Certificate authorities cannot make mistakes or be compromised

    3. C

      Any trusted authority may be able to issue a certificate for a site name

    4. D

      Browsers accept certificates only from the website being visited

    Correct answer
    C

    Any trusted authority may be able to issue a certificate for a site name

    Explanation

    In the described certificate system, many authorities can issue certificates for host names, so compromising one may enable impersonation.

  28. 28

    What is the security consequence of a single certificate authority being compromised in a system that trusts many authorities?

    1. A

      Only websites owned by that authority can be impersonated

    2. B

      The browser stops using encryption for every connection

    3. C

      The attacker may be able to obtain a certificate that impersonates a site

    4. D

      The attacker automatically gains physical access to every user's computer

    Correct answer
    C

    The attacker may be able to obtain a certificate that impersonates a site

    Explanation

    If browsers trust the authority to certify arbitrary host names, a compromised authority may issue a fraudulent certificate for a target site.

  29. 29

    What lesson follows from attackers compromising an unsecured machine that stored operating-system source code?

    1. A

      Only deployed computers, not development machines, belong in a threat model

    2. B

      Source code is safe whenever the finished operating system is secure

    3. C

      A back door in source code cannot affect a compiled operating system

    4. D

      The security of a system can depend on the security of its development process

    Correct answer
    D

    The security of a system can depend on the security of its development process

    Explanation

    An attacker who changes source code before compilation can introduce a back door into the resulting system.

  30. 30

    Why are mechanisms a frequent source of security failures?

    1. A

      They do not participate in enforcing a system's policy

    2. B

      They are always less complex than policies and threat models

    3. C

      They can fail only when an adversary has physical access

    4. D

      They include many interacting software and hardware components that can contain bugs

    Correct answer
    D

    They include many interacting software and hardware components that can contain bugs

    Explanation

    Mechanisms comprise the system components that enforce policy, and their complexity creates many opportunities for implementation errors.

  31. 31

    What protection did limiting password guesses provide in the iCloud example?

    1. A

      It prevented attackers from sending any network packets

    2. B

      It guaranteed that users had chosen unique passwords

    3. C

      It slowed attackers who tried many likely passwords

    4. D

      It ensured that password-reset links could not be intercepted

    Correct answer
    C

    It slowed attackers who tried many likely passwords

    Explanation

    Rate limits or delays reduce the number of password guesses an attacker can make in a given time.

  32. 32

    Why was forgetting to apply password-guessing limits on one iCloud interface significant?

    1. A

      Attackers could use that interface to make many more guesses against the same accounts

    2. B

      The omission changed the password policy to allow any password

    3. C

      The interface automatically revealed every user's password after one failed attempt

    4. D

      The other interfaces stopped requiring passwords entirely

    Correct answer
    A

    Attackers could use that interface to make many more guesses against the same accounts

    Explanation

    A weak interface can undermine protections applied elsewhere, letting attackers make large numbers of guesses against the same accounts.

  33. 33

    In the Citibank account example, what was the effect of changing an identifier in a URL?

    1. A

      It gave the user access only to public information

    2. B

      It could cause the site to display another user's account information

    3. C

      It changed the user's password to the number in the URL

    4. D

      It prevented the website from sending any account information

    Correct answer
    B

    It could cause the site to display another user's account information

    Explanation

    If the site checked that an account identifier was valid but failed to check that it belonged to the logged-in user, changing it could expose another account.

  34. 34

    Which check was likely missing in the Citibank account example?

    1. A

      Whether the requested account belongs to the authenticated user

    2. B

      Whether the server can display account information

    3. C

      Whether the user can type a number into a URL

    4. D

      Whether the account identifier contains any digits

    Correct answer
    A

    Whether the requested account belongs to the authenticated user

    Explanation

    A valid identifier is not enough; the system must also authorize the logged-in user to access the corresponding account.

  35. 35

    Why did a faulty random-number generator threaten Android users' Bitcoin funds?

    1. A

      The generator automatically sent every user's balance to the server

    2. B

      Random values determined whether Bitcoin transactions were displayed correctly

    3. C

      Predictable values prevented users from signing any transaction

    4. D

      Predictable random values could let attackers reproduce keys or signature nonces

    Correct answer
    D

    Predictable random values could let attackers reproduce keys or signature nonces

    Explanation

    Bitcoin security depends on secret keys and, for signatures, fresh unpredictable nonces; predictable values can expose secrets.

  36. 36

    What is the role of a seed in a pseudorandom number generator?

    1. A

      It ensures that every generated value is truly random regardless of the input

    2. B

      It specifies how many transactions a Bitcoin account may make

    3. C

      It initializes the generator so it can produce a sequence of pseudorandom values

    4. D

      It encrypts the generator's output so users can share it publicly

    Correct answer
    C

    It initializes the generator so it can produce a sequence of pseudorandom values

    Explanation

    A pseudorandom generator expands its initial seed into a sequence; if the seed is predictable, the output may be predictable too.

  37. 37

    What follows if a pseudorandom generator is initialized with an all-zero seed in the described failure?

    1. A

      The generator becomes incapable of producing any output

    2. B

      Others using the same predictable initialization may reproduce its output

    3. C

      The generator automatically replaces the seed with fresh entropy

    4. D

      The generated values become more unpredictable than before

    Correct answer
    B

    Others using the same predictable initialization may reproduce its output

    Explanation

    A predictable seed can make the pseudorandom sequence predictable, allowing another party to reproduce the same values.

  38. 38

    Why can reusing a nonce in two signatures expose a private key in the signature scheme described?

    1. A

      The repeated nonce makes the signatures impossible for anyone to verify

    2. B

      The repeated nonce creates a mathematical relationship from which the private key can be recovered

    3. C

      The repeated nonce automatically transfers the signed funds to the attacker

    4. D

      The repeated nonce reveals the user's password to the certificate authority

    Correct answer
    B

    The repeated nonce creates a mathematical relationship from which the private key can be recovered

    Explanation

    The described signature scheme relies on a fresh nonce; reuse can let an attacker use the signatures' mathematical relationship to extract the private key.

  39. 39

    What is the broader security lesson from the random-number and signature failures?

    1. A

      A security mechanism is reliable whenever its API has a reassuring name

    2. B

      Private keys need protection only when they are first generated

    3. C

      Cryptographic systems remain secure even when their random inputs are predictable

    4. D

      Small implementation mistakes in cryptographic mechanisms can have severe consequences

    Correct answer
    D

    Small implementation mistakes in cryptographic mechanisms can have severe consequences

    Explanation

    Errors in initialization or nonce generation can expose secrets and enable theft, despite the intended cryptographic design.

  40. 40

    Why should security testing include edge cases and unusual inputs?

    1. A

      Unusual inputs cannot be supplied by an attacker over a network

    2. B

      Edge cases matter only for performance, not for security

    3. C

      Ordinary inputs always provide more information about security than unusual ones

    4. D

      Boundary conditions can trigger behavior that ordinary inputs do not reveal

    Correct answer
    D

    Boundary conditions can trigger behavior that ordinary inputs do not reveal

    Explanation

    Attackers may deliberately choose very large, small, or unusual inputs to expose mistakes in a system's handling of corner cases.

  41. 41

    What basic representation mismatch caused the certificate-name problem described?

    1. A

      The certificate used a fixed-size string while C code required a variable-size key

    2. B

      The certificate used a length-prefixed string while C code used a null-terminated string

    3. C

      The certificate stored a name in reverse order while C code stored it forward

    4. D

      The certificate used an encrypted string while C code used a numeric address

    Correct answer
    B

    The certificate used a length-prefixed string while C code used a null-terminated string

    Explanation

    The certificate encoding specified a string's length, while the browser's C string handling treated a zero byte as the end.

  42. 42

    How could an embedded zero byte affect the browser's interpretation of a certificate name?

    1. A

      The browser would convert the zero byte into a wildcard character

    2. B

      The browser could treat the name as ending before the certificate's stated length

    3. C

      The browser would treat every later byte as a separate network packet

    4. D

      The browser would automatically remove the certificate's signature

    Correct answer
    B

    The browser could treat the name as ending before the certificate's stated length

    Explanation

    C string processing stops at a zero byte, so it may interpret only the prefix of a longer length-prefixed name.

  43. 43

    Why could an attacker who controlled a domain obtain a misleading certificate in the described example?

    1. A

      A certificate for a name containing the attacker's domain could be truncated by a browser at an embedded zero byte

    2. B

      Browsers ignored the certificate authority's signature for all subdomains

    3. C

      The attacker could change the victim's DNS records by entering a longer name

    4. D

      A certificate authority automatically issued certificates for every domain on the internet

    Correct answer
    A

    A certificate for a name containing the attacker's domain could be truncated by a browser at an embedded zero byte

    Explanation

    The attacker could request a domain name under their control whose encoded bytes began with a target name and included a zero byte; the browser could interpret only the target-name prefix.

  44. 44

    What general risk arises when two system components interpret the same encoded data differently?

    1. A

      An attacker may exploit the disagreement to make one component accept data another interprets differently

    2. B

      The disagreement can affect only the display of non-sensitive information

    3. C

      Both components are guaranteed to reject the data consistently

    4. D

      The data becomes encrypted without the components' knowledge

    Correct answer
    A

    An attacker may exploit the disagreement to make one component accept data another interprets differently

    Explanation

    Different parsing or encoding assumptions can let an attacker craft input that appears valid to one component but has a different meaning to another.

  45. 45

    Why is a zero byte important in C string handling?

    1. A

      It marks the end of a null-terminated string

    2. B

      It marks the beginning of every allocated buffer

    3. C

      It tells the program to execute the following bytes as code

    4. D

      It indicates that a string contains only numeric characters

    Correct answer
    A

    It marks the end of a null-terminated string

    Explanation

    C strings are conventionally terminated by a zero byte, written as \0.

  46. 46

    Why can an encoding bug be difficult to detect by examining only one system component?

    1. A

      Each component may follow its own rules correctly while disagreeing about the data's meaning

    2. B

      Encoding rules are identical across all programming languages

    3. C

      Encoding errors occur only when data is transmitted without encryption

    4. D

      A component cannot inspect data created by another component

    Correct answer
    A

    Each component may follow its own rules correctly while disagreeing about the data's meaning

    Explanation

    A mismatch can arise even if each component follows its own representation rules; the vulnerability lies in their disagreement.

  47. 47

    What is a buffer overflow?

    1. A

      Allocating a buffer that contains no data

    2. B

      Copying data from a larger buffer into a smaller one while checking its length

    3. C

      Reading a buffer without first encrypting its contents

    4. D

      Writing more data into a buffer than it can hold, potentially overwriting adjacent memory

    Correct answer
    D

    Writing more data into a buffer than it can hold, potentially overwriting adjacent memory

    Explanation

    A buffer overflow occurs when data written to a buffer exceeds its capacity and overwrites neighboring memory.

  48. 48

    Why is an unbounded input function dangerous when writing to a fixed-size buffer?

    1. A

      It automatically converts every input byte into executable code

    2. B

      It may continue writing beyond the buffer because it does not enforce the buffer's capacity

    3. C

      It prevents the program from storing any input in memory

    4. D

      It checks the input length but ignores the input's contents

    Correct answer
    B

    It may continue writing beyond the buffer because it does not enforce the buffer's capacity

    Explanation

    If an input function does not limit how many bytes it writes, a long input can overwrite data beyond the buffer.

  49. 49

    In a typical downward-growing x86 stack frame, what may lie near a local buffer?

    1. A

      Only memory that belongs to a different computer

    2. B

      Other local variables and the function's saved control-flow information

    3. C

      No other values, because buffers occupy isolated memory regions

    4. D

      Only the program's permanent source code

    Correct answer
    B

    Other local variables and the function's saved control-flow information

    Explanation

    A stack frame can contain local variables, saved frame information, and a return address near one another.

  50. 50

    Why can overflowing a local buffer alter where a function returns?

    1. A

      The overflow automatically changes the CPU's instruction set

    2. B

      The overflow may overwrite the return address stored nearby on the stack

    3. C

      The return address is always stored inside the buffer itself

    4. D

      The function's return address is recalculated from the input length

    Correct answer
    B

    The overflow may overwrite the return address stored nearby on the stack

    Explanation

    If an overflow reaches the saved return address, it can replace the address the processor will use when the function returns.

  51. 51

    Why did entering a long sequence of A characters make the example program crash?

    1. A

      The program treated every A as a command to shut down the operating system

    2. B

      The input exhausted the disk space reserved for the program

    3. C

      The input overwrote the saved return address with the repeated byte value for A

    4. D

      The program rejected all inputs that contained alphabetic characters

    Correct answer
    C

    The input overwrote the saved return address with the repeated byte value for A

    Explanation

    The unbounded input overwrote stack contents, including the return address; execution then attempted to jump to the invalid address represented by repeated A bytes.

  52. 52

    What does a segmentation fault indicate in the described overflow example?

    1. A

      The program reached the end of its input buffer safely

    2. B

      The program attempted to access or execute an invalid memory location

    3. C

      The operating system repaired the overwritten return address

    4. D

      The input was successfully converted into a valid integer

    Correct answer
    B

    The program attempted to access or execute an invalid memory location

    Explanation

    After the return address was corrupted, the program attempted to execute at an invalid address, resulting in a fault.

  53. 53

    What is the purpose of a function's return address?

    1. A

      It specifies which user is authorized to call the function

    2. B

      It stores the function's input as a null-terminated string

    3. C

      It records the maximum size of the function's local buffer

    4. D

      It identifies where execution should continue after the function returns

    Correct answer
    D

    It identifies where execution should continue after the function returns

    Explanation

    A function call saves a return address so execution can resume at the caller after the function finishes.

  54. 54

    Why might an overflowed program continue running for a while before crashing?

    1. A

      The overflow affects only data that the program never reads

    2. B

      A return address is checked only when the program starts

    3. C

      The operating system always delays memory errors for several minutes

    4. D

      The corrupted control-flow value may not be used until the function returns

    Correct answer
    D

    The corrupted control-flow value may not be used until the function returns

    Explanation

    Corrupting a return address does not necessarily cause an immediate failure; the program may continue until it reaches the return instruction.

  55. 55

    Why might a later string-to-integer conversion complicate analysis of a buffer overflow?

    1. A

      It changes the stack from downward-growing to upward-growing

    2. B

      It prevents the input function from writing past the buffer

    3. C

      It automatically restores all stack values overwritten by the input

    4. D

      It can modify memory after the overflow and affect how the input appears during debugging

    Correct answer
    D

    It can modify memory after the overflow and affect how the input appears during debugging

    Explanation

    In the example, conversion code wrote a zero byte that changed how a debugger displayed the buffer, even though other overwritten stack data remained corrupted.

  56. 56

    Why can exploiting a buffer overflow require more than simply overwriting the return address?

    1. A

      The program must reach and use the corrupted value without earlier code disrupting the intended behavior

    2. B

      The attacker must first alter the computer's physical memory chips

    3. C

      A buffer overflow always terminates the program before input is processed

    4. D

      The return address is never used after input has been read

    Correct answer
    A

    The program must reach and use the corrupted value without earlier code disrupting the intended behavior

    Explanation

    Other instructions may run after the overflow and may alter memory or terminate execution before the corrupted return address is used.

  57. 57

    How can an attacker potentially use a buffer overflow to execute supplied code?

    1. A

      Send code in a packet and rely on the server to compile it automatically

    2. B

      Replace the operating system's source code through an ordinary web request

    3. C

      Use the overflow to grant the input buffer permission to write to disk

    4. D

      Place code in memory and overwrite control flow to jump to that code

    Correct answer
    D

    Place code in memory and overwrite control flow to jump to that code

    Explanation

    A traditional exploit could place code in the input buffer and redirect execution to that memory location.

  58. 58

    What is shellcode in the context of traditional buffer-overflow attacks?

    1. A

      Attacker-supplied machine code intended to perform actions such as starting a shell

    2. B

      The saved return address used by every function call

    3. C

      A special kind of password stored in a web server's configuration

    4. D

      A script that checks whether a buffer is within its allocated size

    Correct answer
    A

    Attacker-supplied machine code intended to perform actions such as starting a shell

    Explanation

    Shellcode is injected code, traditionally intended to start a shell so an attacker can issue commands.

  59. 59

    How can changing the direction in which a stack grows fail to eliminate buffer-overflow risk?

    1. A

      Overflowed data can affect only buffers located below the stack pointer

    2. B

      A stack's direction has no relationship to memory layout

    3. C

      A stack that grows upward cannot store local variables

    4. D

      Overflowed data may still reach saved control-flow information or other sensitive values

    Correct answer
    D

    Overflowed data may still reach saved control-flow information or other sensitive values

    Explanation

    Reversing stack growth does not automatically isolate buffers; adjacent frames or saved return addresses may still be reachable.

  60. 60

    Why might an upward-growing stack make control-flow corruption happen sooner in the example discussed?

    1. A

      The program skips the input function's return when the stack grows upward

    2. B

      The input function's own return address could be reached and used when that function returns

    3. C

      The buffer becomes read-only as soon as input is received

    4. D

      An upward-growing stack removes all function-call return addresses

    Correct answer
    B

    The input function's own return address could be reached and used when that function returns

    Explanation

    In the described layout, overflowing the input function's buffer could overwrite that function's return address and affect control flow immediately upon its return.

  61. 61

    What is a return-to-libc-style attack intended to do?

    1. A

      Change a library function so it no longer has a return address

    2. B

      Replace a program's source code with a library's source code

    3. C

      Encrypt the stack so that no functions can execute

    4. D

      Reuse existing executable code instead of injecting new code

    Correct answer
    D

    Reuse existing executable code instead of injecting new code

    Explanation

    A return-to-libc attack redirects execution to code already present in the process, which can help bypass a non-executable stack.

  62. 62

    What protection does a non-executable stack provide?

    1. A

      It prevents programs from storing any data on the stack

    2. B

      It ensures that every input function checks buffer lengths

    3. C

      It prevents the processor from executing instructions stored in stack memory

    4. D

      It guarantees that stack return addresses cannot be overwritten

    Correct answer
    C

    It prevents the processor from executing instructions stored in stack memory

    Explanation

    A non-executable stack marks stack memory as data rather than executable code, blocking direct execution of injected stack code.

  63. 63

    Why does a non-executable stack not prevent every buffer-overflow exploit?

    1. A

      It prevents the system from checking which memory regions are executable

    2. B

      It makes all attacker-supplied input safe to process

    3. C

      An attacker may redirect execution to useful code that is already executable

    4. D

      It disables all memory permissions once a program starts

    Correct answer
    C

    An attacker may redirect execution to useful code that is already executable

    Explanation

    An attacker may reuse existing executable instructions or functions rather than execute new code from the stack.

  64. 64

    What is the most direct way to fix an unsafe unbounded input operation?

    1. A

      Allow the input to overwrite memory but hide the resulting crash

    2. B

      Make the stack grow in the opposite direction

    3. C

      Assume that network users will send only short inputs

    4. D

      Change the program to use input handling that respects buffer limits

    Correct answer
    D

    Change the program to use input handling that respects buffer limits

    Explanation

    The underlying programming error should be corrected by ensuring input handling cannot write beyond the buffer's capacity.

  65. 65

    What is the trusted computing base in the system-design discussion?

    1. A

      The public data that users are permitted to read

    2. B

      Every program installed on a user's computer, whether relevant or not

    3. C

      The set of adversaries assumed to be unable to attack a system

    4. D

      The components that must work correctly for the system's security policy to hold

    Correct answer
    D

    The components that must work correctly for the system's security policy to hold

    Explanation

    The trusted computing base consists of components whose correct behavior is necessary to enforce security.

  66. 66

    Why can minimizing the trusted computing base improve security?

    1. A

      Fewer components must be trusted to enforce the security policy correctly

    2. B

      It guarantees that every remaining component is free of defects

    3. C

      It ensures that adversaries cannot send inputs to the system

    4. D

      It eliminates the need to define a threat model

    Correct answer
    A

    Fewer components must be trusted to enforce the security policy correctly

    Explanation

    Reducing the number of components on which security depends limits the number of places where a bug can violate the policy.

  67. 67

    Which system design is more robust against bugs in ordinary application components?

    1. A

      One where security depends on all software being bug-free

    2. B

      One where every component independently enforces the entire policy

    3. C

      One where a small number of components enforce security and other components cannot violate the policy

    4. D

      One where no component checks permissions because users are trusted

    Correct answer
    C

    One where a small number of components enforce security and other components cannot violate the policy

    Explanation

    A design that concentrates enforcement in a small trusted core can remain secure even if less-trusted components contain bugs.

  68. 68

    How can security mechanisms enable new capabilities rather than merely restrict behavior?

    1. A

      They make users responsible for detecting every possible attack

    2. B

      They can safely isolate risky programs, allowing users to run them with fewer manual trust decisions

    3. C

      They remove the need for computers to execute software

    4. D

      They guarantee that every program is harmless without inspecting it

    Correct answer
    B

    They can safely isolate risky programs, allowing users to run them with fewer manual trust decisions

    Explanation

    Sandboxing can let a browser run powerful or untrusted code while limiting what that code can do to the user's system.

  69. 69

    What does sandboxing aim to achieve when a browser runs untrusted code?

    1. A

      Make the code's author responsible for every user decision

    2. B

      Prevent the browser from executing any native instructions

    3. C

      Limit the code's ability to affect the rest of the user's system

    4. D

      Allow the code to access all files so that it runs correctly

    Correct answer
    C

    Limit the code's ability to affect the rest of the user's system

    Explanation

    A sandbox constrains a program's actions so that untrusted code can run without unrestricted access to the machine.

  70. 70

    Why should a system not be considered worthless merely because it has a breaking point?

    1. A

      Every discovered weakness disappears once it is documented

    2. B

      Security matters only for systems that have never been tested

    3. C

      A system with a breaking point cannot be attacked in normal use

    4. D

      Its usefulness depends on whether its limits match the threat model and intended context

    Correct answer
    D

    Its usefulness depends on whether its limits match the threat model and intended context

    Explanation

    Every design has limits; understanding those limits helps determine where it is suitable and where it is not.

  71. 71

    What can happen when a security breach exposes sensitive information?

    1. A

      The exposed information becomes confidential again after the attack

    2. B

      The organization may face costly recovery and reputational damage

    3. C

      The system's policy automatically becomes stronger

    4. D

      The breach proves that the threat model was correct

    Correct answer
    B

    The organization may face costly recovery and reputational damage

    Explanation

    A breach can lead to expensive recovery and public consequences, making improved security practically valuable.

  72. 72

    Why is security engineering often an iterative process?

    1. A

      Failures can reveal weaknesses in assumptions or mechanisms that designers then revise

    2. B

      A security policy is complete only after every possible attack has occurred

    3. C

      Threat models never change once a system is released

    4. D

      Iteration allows designers to avoid testing system behavior

    Correct answer
    A

    Failures can reveal weaknesses in assumptions or mechanisms that designers then revise

    Explanation

    Designers may discover that assumptions were wrong or mechanisms had bugs, then revise the system and test it again.

Question 1 of 72
Question 1 of 72

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent