Curated

Security Operations 2 (4.2)

0 votes

Questions57

  1. Question 1

    Security Operations

    A penetration test of a client's order portal shows that a search parameter is concatenated into a SQL statement. The statement runs under a database account with administrative rights. Which three changes best remediate the injection risk? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersA. A database account limited to the tables and actions the app needsB. Parameterized queries that keep input separate from SQL codeC. Server-side allow-list validation of the parameter's expected format

    AWhy this is right: Least privilege limits what injected SQL can read or change, even if one gets through.

    BWhy this is right: Binding input as data means it is never parsed as SQL, which removes the root cause.

    CWhy this is right: Rejecting input that does not match the expected format cuts off many injection payloads.

    DWhy not this: These tokens counter cross-site request forgery, not attacker input altering a query.

    EWhy not this: Output encoding stops cross-site scripting in the page; it does not stop input from changing the SQL statement.

    FWhy not this: Encryption at rest protects stolen storage media, but injected queries run through the app and read decrypted data.

    Parameterized queries stop input from being parsed as SQL, allow-list validation rejects unexpected input, and a least-privilege account limits the damage of any injection that gets through. Anti-forgery tokens defend against cross-site request forgery and do nothing to stop input being interpreted as SQL.

    Open this question
  2. Question 2

    Security Operations

    After a user clicks a crafted link, a script runs in their browser. Server logs show the malicious string sat in the URL fragment and never reached the server. Page JavaScript copied it into the DOM. Which vulnerability is this?

    Show the answer

    Correct answerD. DOM-based XSS

    AWhy not this: this attack forges a request using the victim's session and does not run attacker script in the page.

    BWhy not this: reflected XSS needs the server to echo the input in its response, but the string never reached the server.

    CWhy not this: stored XSS needs the payload saved on the server and served to later visitors, and nothing was saved.

    DWhy this is right: client-side script inserted untrusted fragment data into the DOM with no server involvement.

    DOM-based XSS happens entirely client-side: the page's own JavaScript writes untrusted data, here the fragment, into the DOM unsafely. Reflected XSS also needs a crafted link, but the server must echo the input back, and the logs show it never did.

    Open this question
  3. Question 3

    Security Operations

    A C network daemon crashes intermittently. Crash dumps show a pointer dereferenced after its heap block was freed, and that block had been reallocated holding attacker-supplied data. Which change best addresses the root cause?

    Show the answer

    Correct answerA. Use managed or memory-safe ownership of heap objects

    AWhy this is right: enforced ownership or a memory-safe language prevents a freed object from being dereferenced.

    BWhy not this: locking fixes concurrent access to shared data and does not stop a dangling pointer.

    CWhy not this: bounds checks stop writes past a buffer's end, but this flaw is access to freed memory.

    DWhy not this: ASLR only makes exploitation harder; the dangling pointer is still there.

    This is a use-after-free, an unsafe memory handling flaw. Memory-safe languages or enforced ownership rules prevent a freed object from being used. Bounds checks fix out-of-range writes, which is a different flaw, so they would not stop a dangling pointer.

    Open this question
  4. Question 4

    Security Operations

    A single-page app reads a search term from the URL fragment and writes it into the page with innerHTML. A tester sends a link whose fragment contains script, and it runs in the victim's browser. Server-side output encoding is already in place. Which fix addresses the root cause?

    Show the answer

    Correct answerB. Write the value with textContent instead of innerHTML

    AWhy not this: HttpOnly stops scripts reading the cookie but the injected script still runs and can act in the page.

    BWhy this is right: textContent inserts the value as plain text, so the browser builds no elements and runs no script from it.

    CWhy not this: These prevent SQL injection in the data tier; the script here is injected in the browser.

    DWhy not this: TLS protects data in transit and does not change how the page's script writes the fragment.

    This is DOM-based XSS: the fragment never reaches the server, so server-side encoding cannot help. The flaw is the unsafe sink. Writing the value with textContent makes the browser treat it as text, so no markup or script is created.

    Open this question
  5. Question 5

    Security Operations

    A web form's client-side JavaScript limits a quantity field to digits. A tester bypasses it with an intercepting proxy and submits SQL syntax that the server processes. Which change addresses the root cause?

    Show the answer

    Correct answerD. Repeat the type and range checks on the server

    AWhy not this: Output encoding applies when data is rendered and does not stop SQL syntax reaching the database query.

    BWhy not this: TLS protects data in transit; the tester's malicious request would still arrive intact and be processed.

    CWhy not this: Obfuscation only hides the checks; an attacker who talks to the server directly still bypasses them.

    DWhy this is right: Server-side validation enforces the expected type and range regardless of what the client sends.

    Client-side checks can be bypassed, so the server must validate the type, length and range of every value before using it. Output encoding protects the rendering context and does not stop SQL syntax from reaching the query.

    Open this question
  6. Question 6

    Security Operations

    A developer is evaluating atomic functions to protect shared counters in a multithreaded service. Which statements describe atomic operations? (Choose four.)

    Choose 4 answers

    Show the answer

    Correct answersA. They are often implemented with CPU instructions such as compare-and-swapB. Concurrent updates to a shared counter do not corrupt its valueC. Other threads never see a half-completed updateE. The operation either completes fully or has no effect

    AWhy this is right: Hardware primitives such as compare-and-swap are a common way to build atomic operations.

    BWhy this is right: Because each update is indivisible, simultaneous updates cannot interleave and corrupt the counter.

    CWhy this is right: Indivisibility means no other thread can observe an intermediate state.

    DWhy not this: Checking buffer lengths is a memory-safe function property, not atomicity.

    EWhy this is right: Atomicity is all-or-nothing: the operation finishes completely or leaves no effect.

    FWhy not this: Rejecting malformed data is input validation, which is unrelated to atomicity.

    Atomic operations are indivisible: no intermediate state is visible, they succeed fully or not at all, they commonly rely on hardware instructions like compare-and-swap, and they keep shared values consistent. Bounds checking belongs to memory-safe functions, and format checking to input validation.

    Open this question
  7. Question 7

    Security Operations

    A comment feature must accept any characters, including angle brackets, and later displays each comment in an HTML body and inside an inline JavaScript string. Which control BEST prevents stored cross-site scripting?

    Show the answer

    Correct answerD. Encode each value for its output context when rendered

    AWhy not this: Encryption at rest protects stored data from disclosure but the decrypted comment would still execute when rendered.

    BWhy not this: HTML entity encoding at input does not protect the JavaScript string context and corrupts the stored data.

    CWhy not this: A blocklist is easily evaded and conflicts with the requirement to accept any characters.

    DWhy this is right: Context-specific encoding at output makes the data inert in both the HTML and JavaScript contexts.

    Output encoding applied at render time, matched to each context (HTML body, JavaScript string), neutralizes the data wherever it is displayed while still allowing arbitrary input. A single encoding applied at input fits only one context and leaves the other exposed.

    Open this question
  8. Question 8

    Security Operations

    A coupon endpoint reads a database flag, then sets it to used in a separate statement. Two simultaneous requests redeem the same one-time coupon. Which change fixes this by making the check and update one indivisible step?

    Show the answer

    Correct answerB. Atomic check-and-set operation

    AWhy not this: Validating the code's format does not stop two valid requests from racing on the flag.

    BWhy this is right: An atomic conditional update lets only one request succeed, because no other can run between check and set.

    CWhy not this: Code signing proves software integrity and has no effect on concurrent access to data.

    DWhy not this: Memory-safe functions prevent buffer errors and do nothing about interleaved requests.

    An atomic check-and-set (for example a single conditional update) completes as one indivisible operation, so no second request can slip between the check and the update. Input validation checks the coupon's format but cannot close the race between two valid requests.

    Open this question
  9. Question 9

    Security Operations

    A scan of a newly deployed, fully patched database server finds a vendor default admin account enabled and the listener open on all interfaces. Only one application server needs access. Which action best reduces the attack surface?

    Show the answer

    Correct answerD. Remove the default account and limit the listener to the app server

    AWhy not this: A vault addresses embedded secrets in code, not the enabled default account or the exposed listener.

    BWhy not this: A newer version does not remove a default account or an over-broad listener; the server is already patched.

    CWhy not this: A web application firewall inspects HTTP traffic and does not protect a database listener.

    DWhy this is right: This fixes both defects, default credentials and exposure to every interface, while keeping the application working.

    The findings are insecure configuration: default credentials and unnecessary network exposure. Removing the default account and restricting the listener to the one needed client fixes both. Upgrading does not help because the server is already patched and the weaknesses are configuration choices.

    Open this question
  10. Question 10

    Security Operations

    A malicious page makes a logged-in user's browser submit a transfer request to their bank using their session cookie. Which attack is this?

    Show the answer

    Correct answerA. Cross-site request forgery

    AWhy this is right: The forged request rides on the victim's existing session cookie, which the browser attaches automatically.

    BWhy not this: SSRF makes the server issue requests on the attacker's behalf; here the victim's browser sends the request.

    CWhy not this: SQL injection alters database queries through unsanitized input; no query manipulation is described.

    DWhy not this: XSS runs attacker script in the trusted site's page; here no script runs on the bank's site.

    Cross-site request forgery abuses the browser automatically sending the victim's authenticated session cookie with a request the attacker triggered from another site. Cross-site scripting differs because it runs attacker script inside the trusted site's pages.

    Open this question
  11. Question 11

    Security Operations

    A web app fetches a user-supplied URL to build image previews. A tester shows it can be made to return data from the cloud metadata service at a link-local address. Which control best mitigates this?

    Show the answer

    Correct answerD. Enforce an allow list of permitted destinations for server-side fetches

    AWhy not this: Output encoding prevents script injection in displayed content; it does not stop the server fetching internal data.

    BWhy not this: Client-side checks are bypassed by sending requests directly to the server.

    CWhy not this: CSRF tokens address forged browser requests; they do not limit where the server sends its own requests.

    DWhy this is right: Restricting destinations stops the server being used as a proxy to internal and metadata addresses.

    This is server-side request forgery: the server fetches attacker-chosen destinations, including internal ones. An allow list of permitted destinations, with link-local and internal ranges denied, removes that reach. Client-side validation fails because the attacker controls the request sent to the server.

    Open this question
  12. Question 12

    Security Operations

    An application embeds an anti-CSRF token in each form, yet a forged cross-site POST succeeds. The server only checks that a token field is present, not its value. What is the best fix?

    Show the answer

    Correct answerD. Compare the submitted token to the one bound to the user's session

    AWhy not this: A shorter session narrows the attack window but leaves forged requests valid while the session lasts.

    BWhy not this: Blocking internal destinations mitigates SSRF, which is a server-originated request, not a forged browser request.

    CWhy not this: Output encoding stops XSS; the flaw here is missing token validation, not script injection.

    DWhy this is right: Matching the token to the session value means a forged request, lacking the secret, is rejected.

    A synchronizer token only works if the server verifies that the submitted value matches the secret tied to the session, which an attacker's forged page cannot know. Shortening the session only narrows the window; forged requests still succeed while the session is active.

    Open this question
  13. Question 13

    Security Operations

    A retailer's single-use coupon is redeemed many times when an authenticated user sends parallel redemption requests. Each request passes the "unused" check before any request marks the coupon used. What is the best fix?

    Show the answer

    Correct answerA. Lock the coupon row across the check and the redemption

    AWhy this is right: Holding a lock across check and update lets only one request through at a time, so the coupon can be redeemed once.

    BWhy not this: Format validation checks the code's shape; a valid code can still be redeemed repeatedly in parallel.

    CWhy not this: Rate limiting reduces request volume but does not stop two concurrent requests from both passing the check.

    DWhy not this: A CSRF token proves the request came from the user's own form; the user here is the one sending the parallel requests.

    The flaw is a race condition: the check and the update are separate steps, so concurrent requests all pass the check. Mutual exclusion (a row lock held across both steps) serializes them. Rate limiting only slows requests and does not make the check-and-update exclusive.

    Open this question
  14. Question 14

    Security Operations

    A legacy C service copies user-supplied hostnames into a fixed 64-byte buffer. Crash dumps show overwritten return addresses, and the service cannot be rewritten in another language this quarter. Which change removes the root cause at the affected call sites?

    Show the answer

    Correct answerD. Swap unbounded copies for size-aware string functions

    AWhy not this: Code signing proves who built the binary; it does nothing about a flaw in the code itself.

    BWhy not this: A character allow list restricts content, not length, so a long string of permitted characters still overflows.

    CWhy not this: Encryption protects data in transit; the service still copies the decrypted hostname into the small buffer.

    DWhy this is right: Functions that take the destination size stop the copy at the buffer's end, so the overflow cannot happen.

    Overwritten return addresses come from an unbounded copy overflowing a fixed buffer. Size-aware functions take the destination size and stop at it, removing the flaw without a rewrite. A character allow list does not limit length, so oversized input still overflows.

    Open this question
  15. Question 15

    Security Operations

    A kernel flaw under active exploitation affects 200 Linux production servers behind a load balancer with a 99.99% availability target, and the patch requires a reboot. Which approach BEST reduces risk?

    Show the answer

    Correct answerD. Test on staging, then deploy in phased rings with rollback ready

    AWhy not this: Deferring leaves an actively exploited kernel flaw open, and a WAF cannot stop local or non-web kernel attacks.

    BWhy not this: Patching all servers at once reboots everything together, so a bad patch or reboot breaks the availability target.

    CWhy not this: A patched image fixes only future builds; the 200 running servers stay vulnerable.

    DWhy this is right: Testing, phased rings and rollback patch the exposed servers quickly while the load balancer preserves availability.

    An actively exploited kernel flaw needs prompt patching, and a tested, phased rollout keeps availability because the load balancer drains each ring and rollback is ready. Patching all servers at once risks a regression or reboot outage hitting everything. Updating only the image leaves running servers vulnerable.

    Open this question
  16. Question 16

    Security Operations

    A shared logging library formats timestamps with a function that writes into one static buffer. Under concurrent requests, log lines show timestamps from other requests mixed in. Which fix addresses the cause?

    Show the answer

    Correct answerC. Call a reentrant version that uses a caller-supplied buffer

    AWhy not this: Input validation checks request content; the corruption comes from threads sharing a buffer, not bad input.

    BWhy not this: An atomic counter makes one value indivisible but leaves the shared static buffer unprotected.

    CWhy this is right: Giving each caller its own buffer removes the shared state that concurrent threads were overwriting.

    DWhy not this: Output encoding neutralizes characters for a rendering context; it cannot stop threads overwriting a buffer.

    The function keeps shared state in a static buffer, so concurrent callers overwrite each other's results. A reentrant, thread-safe version uses caller-owned storage, so threads do not share data. An atomic counter protects a single value and does not protect a shared buffer.

    Open this question
  17. Question 17

    Security Operations

    A team made a shared account-transfer function thread-safe by locking both the source and destination account records. Under load the service intermittently hangs, and thread dumps show two threads each holding one lock and waiting for the other. Which change fixes this?

    Show the answer

    Correct answerD. Acquire the locks in the same fixed order in every code path

    AWhy not this: More threads just add more blocked workers; the two threads holding the locks still wait on each other.

    BWhy not this: Memory safety prevents memory-corruption flaws; it does not change the order in which locks are taken.

    CWhy not this: An atomic counter cannot guard a two-record invariant, so the transfer would lose its protection.

    DWhy this is right: A single global lock order prevents the circular wait in which each thread holds what the other needs.

    Two threads locking the same pair of records in opposite orders produce a deadlock. A consistent global lock order breaks the circular wait and keeps the function thread-safe. A larger thread pool only adds more threads that can become stuck.

    Open this question
  18. Question 18

    Security Operations

    A document app checks permissions only when a user first opens a file. Later reads skip the check, so a user whose access was revoked keeps reading the open file. Which security design pattern is being violated?

    Show the answer

    Correct answerD. Complete mediation

    AWhy not this: Fail secure governs behavior when a component fails, not whether each access is authorized.

    BWhy not this: Defense-in-depth adds layered controls; it does not require rechecking authorization on each access.

    CWhy not this: Least privilege limits what rights are granted; the problem here is that revocation is never re-evaluated.

    DWhy this is right: Every access must be rechecked against current policy; skipping checks after the first open lets revoked rights persist.

    Complete mediation requires every access to be checked against the current authorization policy, so revoked rights take effect immediately. Least privilege concerns how narrow the granted rights are, not whether each access is rechecked.

    Open this question
  19. Question 19

    Security Operations

    A composition scan shows a critical, remotely exploitable flaw in a transitive library of a production app. The direct dependency's maintainer has shipped no update, but the library's own project has released a fixed version. What is the BEST action?

    Show the answer

    Correct answerC. Override it with the fixed version after regression testing

    AWhy not this: Transitive libraries run in the app and are just as exploitable as direct ones; risk is not lowered.

    BWhy not this: A virtual patch is a temporary compensating control; the vulnerable library stays in place.

    CWhy this is right: Pinning the fixed version removes the vulnerable code, and testing guards against compatibility breaks.

    DWhy not this: Waiting leaves a critical remote flaw exposed for an unknown time when a fix is already available.

    A fixed version exists, so the vulnerable transitive library should be overridden to it and regression-tested, since the flaw is critical and remotely exploitable. A WAF rule can bridge the gap but does not remove the vulnerable code. Waiting on the maintainer leaves the flaw exposed.

    Open this question
  20. Question 20

    Security Operations

    A plant's control workstation runs an OS whose vendor ended support last year. The certified control application cannot run on a newer OS. Which action BEST reduces the risk?

    Show the answer

    Correct answerB. Isolate it in a restricted segment with allow-listed traffic only

    AWhy not this: No new patches exist for an unsupported OS, so scan findings cannot be fixed this way.

    BWhy this is right: Segmentation with allow-listed traffic limits who can reach the unsupported system, compensating for missing patches.

    CWhy not this: The vendor no longer publishes security updates, so there is nothing to download automatically.

    DWhy not this: Relocating does not change that the OS is unsupported; the same unpatched flaws remain.

    With end-of-life software the vendor no longer issues security fixes, so patching cannot close new flaws. When migration is blocked, compensating controls such as isolation and tight traffic allow-listing limit exposure. Hosting the same OS elsewhere leaves it just as unsupported.

    Open this question
  21. Question 21

    Security Operations

    A mobile banking app ships with an SMS gateway's API key embedded in its binary. A researcher extracts the key from the app package and sends thousands of messages at the company's expense. Which two changes best remove this weakness? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersB. Move calls that need the key to a company backend that holds itE. Revoke the exposed key and issue a new one kept only on the server

    AWhy not this: Obfuscation slows extraction, but the key is still in the binary and can be recovered.

    BWhy this is right: The key never reaches the device, and the backend can authenticate users and limit what they send.

    CWhy not this: The app must decrypt the file to use the key, so its decryption key is on the device as well.

    DWhy not this: Base64 is reversible encoding, not protection; anyone can decode it.

    EWhy this is right: The extracted key stays usable until revoked, and the new key never ships to devices.

    FWhy not this: Pinning protects the connection from interception but leaves the key in the app for extraction.

    Anything shipped inside a client app can be extracted, so the key must leave the app: the app calls the company's backend, which holds the key and makes the SMS request. The exposed key must also be revoked, because moving the code does not stop someone using a key they already have. Obfuscation, encoding and local encryption only slow extraction.

    Open this question
  22. Question 22

    Security Operations

    A scanner finds a live cloud access key in a private repository's commit history from three months ago. The current code no longer contains it. What should the team do FIRST?

    Show the answer

    Correct answerB. Revoke the key and reissue it from a secrets manager

    AWhy not this: Cleaning history helps, but existing clones, forks and backups keep the key, so it stays usable until revoked.

    BWhy this is right: Revoking invalidates every copy of the exposed key, and a secrets manager keeps the replacement out of code.

    CWhy not this: Fewer people with access does not undo exposure that has already happened; the key still works.

    DWhy not this: Encryption at rest protects stored data, not a credential already readable by anyone with repository access.

    A secret that has been committed must be treated as compromised, because clones and backups may still hold it. Revoking it and issuing a replacement closes the exposure. Purging history is worthwhile later, but it cannot recall copies that already exist.

    Open this question
  23. Question 23

    Security Operations

    What does a security patch for installed software primarily do?

    Show the answer

    Correct answerC. Fixes known flaws in the software's code

    AWhy not this: Removing unneeded features is least functionality and does not repair flaws in the remaining code.

    BWhy not this: Restricting privileges is least privilege, which is configured separately and is not what a patch does.

    CWhy this is right: A patch replaces the vulnerable code with a corrected version from the vendor.

    DWhy not this: Encryption protects stored data and does not correct vulnerabilities in the software.

    A security patch is a vendor code change that corrects a known vulnerability. Removing unused features is least functionality, a separate mitigation that does not fix flawed code.

    Open this question
  24. Question 24

    Security Operations

    A vendor releases a hypervisor update that fixes a VM escape flaw. The guest OSs on the host are fully patched. What is the most appropriate action?

    Show the answer

    Correct answerD. Move guests to another host, then patch the hypervisor

    AWhy not this: New guest images leave the vulnerable hypervisor underneath untouched.

    BWhy not this: The flaw is in the hypervisor, not the guest OS, so guest updates cannot fix it.

    CWhy not this: Least privilege limits what guest accounts can do and does not remove a hypervisor flaw.

    DWhy this is right: The flaw is in the host layer; migrating guests first lets the hypervisor be patched without an outage.

    A VM escape flaw lives in the hypervisor layer beneath the guests, so only a hypervisor update fixes it. Moving guests first keeps workloads running during the host reboot. Patching or rebuilding guests does not change the hypervisor.

    Open this question
  25. Question 25

    Security Operations

    The OS and hypervisor on a server are fully patched, yet a scan flags a remote code execution flaw in its baseboard management controller. Which action remediates it?

    Show the answer

    Correct answerC. Flash the vendor's signed BMC firmware update

    AWhy not this: A system image holds the OS and software; it does not rewrite the BMC's firmware.

    BWhy not this: The hypervisor is already patched and runs above the BMC, so updating it cannot change BMC code.

    CWhy this is right: Flashing the vendor's signed firmware replaces the vulnerable code on the controller itself.

    DWhy not this: OS updates change the operating system only, not firmware held on the management controller.

    The BMC runs its own firmware, stored on the device, so only a vendor firmware update fixes it. Verifying the signature confirms the image is authentic. Reimaging replaces the OS but leaves the BMC firmware unchanged.

    Open this question
  26. Question 26

    Security Operations

    Servers are deployed from a golden system image that is several patch cycles old, so new instances boot with known vulnerabilities. Which actions keep the image trustworthy going forward? (Choose four.)

    Choose 4 answers

    Show the answer

    Correct answersB. Block new deployments from superseded images that contain known vulnerabilitiesD. Record a hash or signature of the released image and verify it before deploymentE. Test the patched image in staging before releasing it to productionF. Rebuild the image with current OS and application patches, then deploy from it

    AWhy not this: New instances would still come up from the old, vulnerable image and need patching again.

    BWhy this is right: Blocking superseded images stops vulnerable builds from being redeployed.

    CWhy not this: Open write access breaks least privilege and lets anyone tamper with the trusted image.

    DWhy this is right: A verified hash or signature shows the image has not been altered or swapped.

    EWhy this is right: Staging tests catch patch-related breakage before it reaches production.

    FWhy this is right: Updating the image itself means every new instance starts patched.

    Patches must go into the image itself, be tested, be integrity-protected, and old vulnerable images must stop being deployable. Patching only running instances leaves every new deployment vulnerable, and open write access lets anyone tamper with the image.

    Open this question
  27. Question 27

    Security Operations

    A scan flags a third-party PDF reader on workstations for a remote code execution flaw, although OS patch reporting shows 100% compliance. Which action remediates the finding?

    Show the answer

    Correct answerD. Deploy the vendor's fixed reader version through patch management

    AWhy not this: OS updates patch the operating system, not third-party applications, so the reader stays vulnerable.

    BWhy not this: Firmware updates fix low-level device code and do not change an installed application.

    CWhy not this: Allow listing approves the reader to run and leaves the vulnerable code in place.

    DWhy this is right: Applying the vendor's fixed version through patch management removes the flaw in the application itself.

    The flaw is in an installed application, so only the vendor's fixed application version removes it. OS updates do not cover third-party software. Allow listing permits the vulnerable reader to run, so it does not remove the flaw.

    Open this question
  28. Question 28

    Security Operations

    A nightly backup job runs under a service account that is a domain administrator, though it only reads file shares and writes to a backup repository. What should the architect recommend?

    Show the answer

    Correct answerC. Remove domain admin rights and grant only file-read and repository-write permissions

    AWhy not this: Limits where the account logs on, but a compromise there still carries full admin rights.

    BWhy not this: Encryption protects stored backups; it does not reduce the account's permissions.

    CWhy this is right: Cuts the account to the minimum rights the job needs, limiting damage if it is abused.

    DWhy not this: Protects the credential but leaves the unnecessary domain admin rights intact.

    Least privilege gives an account only the permissions its task needs, so a compromised backup account cannot administer the domain. Stronger passwords or logon restrictions harden the credential but leave excessive rights in place.

    Open this question
  29. Question 29

    Security Operations

    During a power and network failure, a hospital's door controllers cannot verify badges. One door is a stairwell fire exit used for evacuation; the other guards a controlled-substances storage room. Which lock configuration is BEST?

    Show the answer

    Correct answerC. Stairwell door fails safe and unlocks; storage room door fails secure and stays locked

    AWhy not this: Protects the storage room but traps people in the stairwell during an emergency.

    BWhy not this: Allows evacuation but leaves controlled substances open to anyone during the outage.

    CWhy this is right: Matches each door's priority: evacuation safety for the stairwell, asset protection for the storage room.

    DWhy not this: Reverses both priorities: it locks the exit and exposes the storage room.

    Fail safe favors human safety, so the evacuation door must unlock; fail secure favors protecting assets, so the controlled-substances room must stay locked when badges cannot be verified. Setting both the same way sacrifices either life safety or asset protection.

    Open this question
  30. Question 30

    Security Operations

    Policy requires the KMS key that encrypts a database's backups to rotate annually; no compromise has occurred. Years of existing backups must stay restorable. Which approach meets the policy?

    Show the answer

    Correct answerB. Create a new key version for new encryption and keep the old version to decrypt existing backups

    AWhy not this: Access restriction is a different control and does not rotate the key.

    BWhy this is right: New data uses the fresh version, and retained old versions keep older backups readable.

    CWhy not this: Extending validity keeps the same key in use, so no rotation happens.

    DWhy not this: Destroys the key needed to decrypt existing backups, making them unrecoverable.

    Rotation puts a new key version into use for new encryption while the retired version stays available for decryption until old data is re-encrypted. Deleting the old version immediately makes existing backups unreadable.

    Open this question
  31. Question 31

    Security Operations

    A scan flags a vulnerable OpenSSL library in the base layer of a container image behind 40 running containers. The orchestrator replaces containers from this image on every restart, and the hosts are fully patched. Which action BEST remediates the finding?

    Show the answer

    Correct answerB. Rebuild the image from an updated base layer and redeploy the containers

    AWhy not this: Fixes only the running instances; replacements still start from the vulnerable image.

    BWhy this is right: Fixes the library at its source, so every container started from the image is patched.

    CWhy not this: Hypervisor patches protect the virtualization layer, not libraries inside a container image.

    DWhy not this: Host OS patches do not change libraries packaged inside the container image.

    The vulnerable library is baked into the image, so the fix is to rebuild the image from a patched base and redeploy. In-place updates inside running containers look reasonable, but they vanish when the orchestrator replaces the container from the old image.

    Open this question
  32. Question 32

    Security Operations

    Windows hosts on a segment fail DNS resolution for a mistyped server name, then broadcast name queries that a tester's host answers with its own address. Which control best removes this attack path?

    Show the answer

    Correct answerD. Disable LLMNR and NBT-NS through Group Policy

    AWhy not this: Blocking outbound DNS does not affect local fallback queries that are answered by a host on the same segment.

    BWhy not this: SMB signing limits relaying of captured authentication but does not stop hosts being tricked by forged name answers.

    CWhy not this: ARP inspection stops forged IP-to-MAC mappings, but this attack forges name-query answers, not ARP replies.

    DWhy this is right: Turning off LLMNR and NBT-NS removes the broadcast fallback queries that a rogue host can answer.

    The hosts fall back to LLMNR and NBT-NS multicast or broadcast queries after DNS fails, and any host can answer them. Disabling those protocols removes the fallback. ARP inspection protects the IP-to-MAC mapping, which this attack does not alter.

    Open this question
  33. Question 33

    Security Operations

    Resolvers at an ISP return a fraudulent IP address for a company's domain, though the company's authoritative servers hold correct records. Which control lets resolvers detect the forged answers?

    Show the answer

    Correct answerB. Sign the zone and have resolvers validate with DNSSEC

    AWhy not this: A WAF inspects HTTP traffic to the site and has no effect on what a resolver caches.

    BWhy this is right: DNSSEC signatures let validating resolvers reject DNS answers that were not signed by the zone owner.

    CWhy not this: HSTS enforces HTTPS for a known site but does not validate DNS answers or stop the cache holding forged data.

    DWhy not this: A shorter TTL only shortens how long a bad entry lives; it does not let resolvers detect forgery.

    This is DNS cache poisoning: a resolver stores forged data. DNSSEC signs records so validating resolvers can reject answers that fail signature checks. HSTS only forces HTTPS once a browser is on the real site, and does not stop resolvers caching bad records.

    Open this question
  34. Question 34

    Security Operations

    A fuzzer crashes a C parser. A length field set to its maximum value wraps to zero after the parser adds a header size, a tiny heap buffer is allocated, and the full payload is then copied in. Which change best fixes the root cause?

    Show the answer

    Correct answerD. Check the length for wraparound before computing the allocation size

    AWhy not this: Zeroing freed blocks targets use-after-free data leaks, and this flaw involves no freed memory.

    BWhy not this: ASLR makes exploitation harder but leaves the undersized allocation and overflow in place.

    CWhy not this: Canaries detect stack smashing, but this overwrite happens in a heap buffer.

    DWhy this is right: Checking the arithmetic stops the wrapped size and so the undersized allocation that the copy overruns.

    The flaw is an integer overflow in the size calculation that leads to a heap buffer overflow. Validating the length and using checked arithmetic removes the cause. Stack canaries guard return addresses on the stack, so they would not stop this heap overwrite.

    Open this question
  35. Question 35

    Security Operations

    An assessment finds an application server trusted for Kerberos delegation to any service, and domain administrators sometimes sign in to it. The application only needs to reach one back-end SQL service as the user. Which change best reduces the risk?

    Show the answer

    Correct answerC. Switch to constrained delegation limited to the SQL service principal name

    AWhy not this: A longer password hardens the account against offline guessing but leaves the delegation scope unchanged.

    BWhy not this: Anonymous binds expose directory data but are unrelated to how far delegated tickets can be used.

    CWhy this is right: Constrained delegation confines impersonation to the named SQL service, so a compromised server cannot act as users elsewhere.

    DWhy not this: LDAP signing protects LDAP traffic integrity and does not limit where the server can impersonate users.

    Unrestricted delegation lets anyone who reaches the server be impersonated to any service in the domain, including administrators. Constrained delegation limits impersonation to the one SQL service the application needs. LDAP signing and anonymous-bind controls are valid hardening but do not address delegation scope.

    Open this question
  36. Question 36

    Security Operations

    A scanner flags calls to a function its vendor deprecated in favor of a safer one. What is the best response?

    Show the answer

    Correct answerD. Replace the calls with the vendor's recommended function

    AWhy not this: Renaming only hides the finding and leaves the deprecated function in use.

    BWhy not this: A firewall rule does not change what the code does inside the application.

    CWhy not this: Compiling successfully says nothing about safety; the function stays unmaintained or unsafe.

    DWhy this is right: Moving to the supported replacement removes the use of the unsafe or unmaintained function.

    Vendors deprecate functions because they are unsafe or will no longer be maintained, so the fix is to move to the recommended replacement. Code compiling does not mean the function is safe, so suppressing the finding leaves the risk.

    Open this question
  37. Question 37

    Security Operations

    A Java application keeps session state as a serialized object in a client-supplied cookie. A tester gets remote code execution by altering the object bytes, with no SQL or script characters involved. What is the best fix?

    Show the answer

    Correct answerD. Replace native serialization with a data-only format and validate it against a schema

    AWhy not this: This blocks SQL injection, but no SQL was involved in this attack.

    BWhy not this: TLS protects traffic in transit, but the attacker supplies the cookie from the client side.

    CWhy not this: Output encoding stops XSS in browsers, not code execution during server-side deserialization.

    DWhy this is right: A data-only format with validation stops untrusted bytes from being turned into live objects.

    Deserializing attacker-controlled bytes can instantiate unexpected classes and run code, so the app should not rebuild objects from untrusted input; a simple data format with schema validation avoids it. Parameterized queries stop SQL injection, which is not what happened here.

    Open this question
  38. Question 38

    Security Operations

    A code review finds that an application calls a library function the vendor deprecated because of an unfixable security flaw. The vendor documents a supported replacement. What should the team do?

    Show the answer

    Correct answerC. Replace each call with the vendor's supported function

    AWhy not this: Pinning freezes the version that still contains the deprecated function, so the flaw stays.

    BWhy not this: Hiding the warning leaves the unfixable flaw in place and only removes the reminder.

    CWhy this is right: The supported replacement is maintained and removes the flawed function from the code.

    DWhy not this: Validation may reduce exposure, but the function's own flaw remains and is never patched.

    A deprecated function is no longer maintained, so its flaw will never be fixed. Migrating to the supported replacement removes the flawed code path. Input validation is only a compensating control and leaves the unsafe function in use.

    Open this question
  39. Question 39

    Security Operations

    A privileged upload service checks that the requesting user may read a file path, then opens that path moments later. A tester shows a user can swap the path for a symbolic link to a protected file between the two steps. Which three changes best remove the flaw? (Choose three.)

    Choose 3 answers

    Show the answer

    Correct answersB. Keep the working files in a directory that unprivileged users cannot write toC. Open the file once and run the checks against the open handle, not the pathF. Drop to the requesting user's privileges before opening the file

    AWhy not this: A clean file name does not stop a path from being replaced by a link after the check.

    BWhy this is right: If attackers cannot write to the directory, they cannot place the link that wins the race.

    CWhy this is right: Checking the open handle ties the check and the use to the same object, so a swap has no effect.

    DWhy not this: Encryption protects confidentiality at rest but does not stop the path being swapped.

    EWhy not this: Repeating the check still leaves a gap between check and use that an attacker can race.

    FWhy this is right: Opening as the user makes the operating system enforce access at the moment of use.

    TOCTOU is fixed by removing the gap or the attacker's ability to change the resource: bind the check to the opened object, let the OS enforce the user's rights, and deny write access to the location. A second check only narrows the window and the race remains.

    Open this question
  40. Question 40

    Security Operations

    A managed service provider's shared administrator account is stolen in the provider's own breach, and attackers use it to log in to a client's fully patched, hardened network. Which recommendation best reduces this attack surface?

    Show the answer

    Correct answerD. Give each vendor individual, least-privilege, MFA-protected, time-limited access

    AWhy not this: Default credentials were not used; a legitimate vendor account was.

    BWhy not this: The servers were already patched, and the attacker logged in with a valid vendor account.

    CWhy not this: Embedded secrets are a different weakness and played no part in this intrusion.

    DWhy this is right: Individual, limited, MFA-backed access shrinks what a compromised vendor can reach.

    The entry point was a third party's compromised, over-privileged shared credential, so the fix is to tightly control and monitor vendor access. Patching is tempting but the internal systems were already patched and the attacker used a valid login.

    Open this question
  41. Question 41

    Security Operations

    A company's only protection for its customer database is a perimeter firewall. After a phishing compromise, an attacker on an internal workstation reached the database freely. Which approach BEST addresses the design weakness?

    Show the answer

    Correct answerA. Add layered controls: internal segmentation, host hardening, and database encryption

    AWhy this is right: Independent layers inside the network and at the data mean one failed control does not expose the database.

    BWhy not this: Faster patching helps but remains one control and leaves the flat network and exposed data.

    CWhy not this: A stronger perimeter is still a single layer and does nothing against an attacker already inside.

    DWhy not this: Blocking attachments is a single preventive control and cannot stop other ways in.

    The weakness is reliance on a single control. Defense-in-depth places several independent controls so that one failure does not expose the data. A better firewall is still one perimeter layer that an internal attacker bypasses.

    Open this question
  42. Question 42

    Security Operations

    A policy replaces a service's encryption key every 90 days so a silently stolen key eventually stops working. Which practice is this?

    Show the answer

    Correct answerA. Key rotation

    AWhy this is right: Replacing a key on a fixed schedule is key rotation, and it caps the useful life of a stolen key.

    BWhy not this: Escrow keeps a recoverable copy of a key with a trusted party; it does not replace the key.

    CWhy not this: Stretching strengthens a weak password-derived key by iterating it; it does not change the key over time.

    DWhy not this: Pinning ties a client to an expected certificate or public key; it does not replace encryption keys.

    Key rotation replaces a key on a schedule, which limits how long a stolen or weakened key is useful. Key escrow is tempting but only stores a copy of a key with a trusted party for recovery; it does not retire the key.

    Open this question
  43. Question 43

    Security Operations

    A build resolves package names from both private and public registries, taking the highest version, so a public package reusing an internal name with a higher version gets pulled. Which control BEST stops this while keeping other public packages usable?

    Show the answer

    Correct answerB. Bind internal package names to the private registry and lock hashed versions

    AWhy not this: This stops the attack but breaks the requirement to keep using public packages and adds manual work.

    BWhy this is right: Pinning internal names to the private source and verifying hashes prevents the higher public version being chosen.

    CWhy not this: Composition scans match known vulnerabilities; a brand-new malicious package has no CVE entry.

    DWhy not this: Signing happens after the malicious package is included, so it vouches for a tainted build.

    This is dependency confusion. Binding internal names to the private registry and locking hashed versions means a higher public version is never selected, while other names still resolve publicly. Code signing only vouches for the artifact after the malicious package was already built in.

    Open this question
  44. Question 44

    Security Operations

    A popular open-source package's maintainer account was hijacked, and a malicious patch release was published. Within an hour, CI builds of several services pulled it, because their manifests declare version ranges and no lockfile is committed. Which practice would have kept the builds on the reviewed version?

    Show the answer

    Correct answerD. Committing lockfiles with pinned versions and hashes, updated only by review

    AWhy not this: Static analysis examines the code the team wrote and does not control which dependency versions a build pulls in.

    BWhy not this: An SBOM records which versions went into a build, including a malicious one, but does not stop the build resolving it.

    CWhy not this: Signing proves the team released the artifact unaltered, even when it already contains the malicious package.

    DWhy this is right: Pinned versions and hashes keep builds on reviewed releases, so a new upstream release enters only through a reviewed update.

    Version ranges let a build resolve whatever release is newest, so a hijacked release flows straight in. A committed lockfile pins each direct and transitive dependency to an exact version and integrity hash, so new releases enter only through a reviewed update. An SBOM would record the malicious version but not stop it being pulled.

    Open this question
  45. Question 45

    Security Operations

    An application server already runs under a minimally privileged account, but it still exposes an FTP service and sample applications the business never uses. Which action BEST reduces the attack surface?

    Show the answer

    Correct answerA. Uninstall the unused FTP service and sample apps

    AWhy this is right: Removing features the business does not use eliminates their listeners and flaws, which is least functionality.

    BWhy not this: Rotating credentials limits the life of a stolen secret but leaves the unneeded services running.

    CWhy not this: This is least privilege, already applied here; the unused services would still be exposed.

    DWhy not this: TLS protects traffic in transit, but the unneeded service remains an attack surface.

    Least functionality means removing or disabling features, services and software that are not needed, so the vulnerable code and listeners no longer exist. Tightening the account is least privilege, which is already in place and does not remove the exposed services.

    Open this question
  46. Question 46

    Security Operations

    A server reimaged from a verified clean golden image resumes beaconing to an unknown host within minutes. Its firmware hash differs from the vendor's published value. What is the MOST likely cause?

    Show the answer

    Correct answerA. A firmware implant that persists below the operating system

    AWhy this is right: Code in firmware survives reimaging and explains the altered firmware hash and the quick return of the beacon.

    BWhy not this: Cache poisoning redirects lookups but does not alter firmware or explain a hash mismatch on the server.

    CWhy not this: Reinfection through an old flaw would explain the beaconing but not a firmware hash that differs from the vendor's value.

    DWhy not this: A timing flaw in scripts does not produce beaconing to an unknown host or change firmware contents.

    A mismatched firmware hash plus malicious behavior that survives a clean reimage points to an implant in firmware, which lives below the OS and is not touched by reimaging. Re-exploitation of an unpatched library is plausible, but it would not change the firmware hash.

    Open this question
  47. Question 47

    Security Operations

    A SaaS reporting service assumes roles in customer cloud accounts using its own privileged identity. A tenant supplies another customer's role ARN and receives that customer's data. Which control BEST prevents this?

    Show the answer

    Correct answerC. Require a customer-specific external ID in each role's trust policy

    AWhy not this: The service calls legitimate cloud APIs, so an outbound allow list would not detect or block use of the wrong role.

    BWhy not this: The tenant is already a legitimate authenticated user; MFA does not stop that user from naming another customer's role.

    CWhy this is right: The external ID makes the service prove the request is tied to this customer's role, so it cannot be tricked into using its privileges.

    DWhy not this: CSRF tokens stop forged browser requests from a victim's session, but here the tenant deliberately sends the request itself.

    The service is a confused deputy: it uses its own privileges on behalf of a requester who has no right to them. A unique external ID in the trust policy ties each role to the customer who legitimately onboarded it. MFA only proves who the tenant is, not which role it may target.

    Open this question
  48. Question 48

    Security Operations

    A .NET service reads messages from a queue that several partner systems publish to, and it deserializes each message with BinaryFormatter after verifying the partner's signature. A red team uses one compromised partner system to publish a validly signed gadget-chain payload and gains code execution. Which change BEST removes the weakness?

    Show the answer

    Correct answerC. Replace BinaryFormatter with a serializer bound to declared types

    AWhy not this: Key rotation still lets a compromised partner sign messages with its current key, and the payload is unchanged.

    BWhy not this: Lower privilege limits what the injected code can do, but the code still runs during deserialization.

    CWhy this is right: A serializer that maps data only to declared types never instantiates attacker-chosen classes, so no gadget chain runs.

    DWhy not this: TLS protects messages in transit; the malicious payload comes from a trusted, connected partner.

    BinaryFormatter rebuilds whatever types the payload names, so a gadget chain runs code during deserialization; a serializer such as System.Text.Json binds only to declared types. Microsoft states it cannot be made secure and removed it from .NET 9. A signature only proves which partner sent the message, so a compromised partner still delivers a valid one.

    Open this question
  49. Question 49

    Security Operations

    Staff find a small unauthorized device between a keyboard and a PC that silently records every keystroke. What is this device?

    Show the answer

    Correct answerA. Hardware implant

    AWhy this is right: A planted physical device that covertly captures data is a hardware implant, and an inline keylogger is a common type.

    BWhy not this: A rogue access point offers unauthorized wireless network access; it does not sit on a keyboard cable recording keys.

    CWhy not this: A firmware rootkit is malicious code in existing firmware, not a separate device added between keyboard and PC.

    DWhy not this: A network tap copies network traffic on a network link; it does not capture keystrokes from a keyboard cable.

    A hardware implant is a malicious physical device or component placed in a system to capture data or give covert access, and an inline keystroke logger is a typical example. A firmware rootkit is malicious code, not an added device, and a rogue access point gives network access rather than recording input.

    Open this question
  50. Question 50

    Security Operations

    A TLS 1.2 gateway still offers 3DES and static RSA key exchange for a legacy partner. Auditors want weak ciphers removed and recorded traffic to stay confidential even if the server's private key is later stolen. Which change BEST meets both?

    Show the answer

    Correct answerA. Permit only ECDHE with AES-GCM suites; remove 3DES and static RSA

    AWhy this is right: ECDHE gives forward secrecy and AEAD suites like AES-GCM replace weak ciphers, satisfying both requirements.

    BWhy not this: HSTS forces HTTPS use and stapling speeds revocation checks; neither changes the cipher suites or key exchange.

    CWhy not this: Dropping old protocol versions helps, but 3DES and static RSA stay available on TLS 1.2, so both requirements still fail.

    DWhy not this: A longer key does not add forward secrecy and leaves 3DES and static RSA negotiable, so neither requirement is met.

    3DES is a weak block cipher, and static RSA key exchange lacks forward secrecy, so a stolen private key decrypts recorded sessions. ECDHE with AEAD suites removes both problems. A longer RSA key leaves the suites unchanged and gives no forward secrecy.

    Open this question