100% Latest & Updated CompTIA SY0-701 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 80
A project collaboration folder unexpectedly allows external guests to open a confidential budget. The owner wants to preserve authorized internal access while removing unintended sharing. What should be changed?
- Enable alerts on future external-share invitations but retain the guest identities already able to read this folder.
- Inspect inherited and direct share permissions and remove the unintended external identities.
- Add an extra descriptive column to the budget spreadsheet.
- Create a wider public share link and ask guests not to use it.
Explanation
Correct Answer
B:Effective permission review closes the particular guest access path while retaining approved internal collaboration. Checking inherited group memberships, explicit shares and public-link settings identifies the actual principals with access. Removing only the unauthorized guest paths preserves the business-approved internal collaboration rather than locking everyone out.
Incorrect Answers
A:An invitation alert improves detection of new sharing mistakes; it does not revoke the current guest permissions that already disclose the budget. The owner must inspect inherited, link-based and direct grants, remove unintended recipients, and test that authorized internal collaborators still retain access. Monitoring can supplement, but not replace, that access change.
C:Metadata cannot override the collaboration service's permission grants. A new spreadsheet column describes content but is not evaluated by the file-sharing authorization engine. Effective access is determined by the service's inherited and direct grants, not arbitrary cells inside the document.
D:Expanding anonymous link access worsens the exposure rather than removing the unauthorized principals. A broadly accessible link adds another route through which outsiders can retrieve the budget. An informal request not to use it is unenforceable; the owner must remove the unauthorized grant at the service.
Question 81
A product-search parameter is concatenated directly into SQL text; test inputs containing quotes alter the WHERE clause. Which coding change closes the injection path without discarding the user's search text?
- Increase the database worker pool during suspicious searches.
- Replace string concatenation with a prepared query and bound parameters.
- Escape the user-visible HTML after database processing completes.
- Enable TLS between the browser and the web server only.
Explanation
Correct Answer
B:The engine treats the supplied search value as data even when it contains SQL punctuation. Binding the search value to a typed query parameter keeps quote characters and operators within the value itself. The intended product search still works, but the database parser no longer treats those user bytes as instructions.
Incorrect Answers
A:More capacity does not distinguish values from SQL commands or prevent altered query semantics. Expanding connections only increases how many unsafe queries the application may run. An input containing SQL quotes would still alter the parsed WHERE expression because the program constructed syntax from that same uncontrolled search value.
C:Output encoding can reduce XSS but cannot repair an unsafe query already sent to the database parser. HTML escaping belongs at the later browser-rendering boundary and can prevent some cross-site scripting. Here the altered WHERE clause was interpreted by the database before any search result was encoded for display.
D:Encryption protects transport while malicious SQL text still reaches the vulnerable query assembly logic. TLS secures the channel that carries the request; the server still concatenates the received parameter into SQL. Transport protection cannot distinguish malicious query syntax from legitimate search text inside the application's code.
Question 82
A support portal stores customer comments and displays them to other users. A malicious comment containing script executes in a reviewer's browser. Select THREE safeguards that jointly remove the immediate flaw, constrain script execution, and prove the fix.
- Permit arbitrary inline JavaScript because the comment database is internal.
- Strip every apostrophe from customer comments and assume all other input is safe.
- Deploy a restrictive Content Security Policy that rejects unapproved inline and remote scripts.
- Apply context-appropriate output encoding or a vetted HTML sanitizer when rendering saved comments.
- Test stored payloads in the actual comment display contexts and confirm no script runs.
- Remove literal <script> tags from saved comments at input time while allowing other markup to render unchanged.
Explanation
Correct Answers
C:Browser-enforced script restrictions reduce exploit impact if an unsafe rendering path remains. The policy should disallow unnecessary inline execution and restrict permitted script sources, so accidental rendering flaws face an additional browser-enforced obstacle. CSP is defense in depth, not a substitute for correctly handling the stored comment itself.
D:Untrusted comment content must be rendered as harmless text or strictly allowed markup, not executable script. Encoding for the actual output context prevents the browser from treating customer-controlled markup as JavaScript. If limited formatting is required, a maintained sanitizer must allow only safe elements and attributes rather than blindly preserving all HTML.
E:End-to-end regression evidence detects failures that a static code change alone might overlook. A regression test must save a hostile comment and reopen the same interface as a different user to exercise the stored execution path. Testing only the submission form would miss vulnerable presentation templates or alternate display views.
Incorrect Answers
A:An internal comments database can store attacker-controlled input when public or customer-facing users are permitted to post. Trusting the database’s location would let that stored markup execute with a reviewer’s browser privileges when rendered without encoding. The correct defense is to treat the comment as untrusted at its output context and limit script execution, rather than assume internal storage makes it safe.
B:A single punctuation filter cannot account for HTML, attribute, URL and JavaScript execution contexts. Removing apostrophes treats one possible character as the entire problem. Browser interpretation depends on whether the value enters text, an attribute, a URL or script context, and many payloads need no apostrophe at all.
F:Filtering known script tags may block a few obvious payloads, making it a plausible first attempt. Stored XSS can also use event-handler attributes, URL contexts, and other browser interpretation paths that a single tag blacklist misses. The selected encoding or sanitization, CSP defense-in-depth, and actual rendering tests address the broader failure mechanism together.
Question 83
A service written in C copies an unchecked username into a 64-byte stack buffer; long input crashes the process and corrupts return state. Select TWO engineering actions that address the unsafe operation and verify the correction.
- Replace the unbounded copy with checked-length handling or a memory-safe implementation.
- Exercise long inputs with memory sanitizers and targeted fuzz cases in the test environment.
- Log the username only after the unsafe copy completes.
- Increase the server's HTTP connection limit while leaving the copy unchecked.
- Suppress process-crash alerts and restart automatically after each failure.
Explanation
Correct Answers
A:Ensuring the destination capacity is respected removes the direct overwrite path for oversized usernames. The 64-byte destination has a fixed capacity, while unbounded copying follows attacker-controlled input length. Length checks or safe data structures must reject or truncate values before writing beyond the valid region, not after a corrupted return state is observed.
B:Instrumented negative testing reveals remaining out-of-bounds reads or writes under hostile input lengths. Fuzzing long and boundary-length inputs with memory instrumentation can reveal violations that normal usernames never trigger. A passing regression should cover maximum accepted lengths and oversized values on the actual revised code path.
Incorrect Answers
C:The memory overwrite can happen before logging, so after-the-fact evidence cannot prevent the crash. The overflow occurs during the unsafe copy, potentially corrupting stack memory and control data before any log entry is written. Evidence collection cannot turn an unchecked memory write into a bounds-checked operation.
D:Concurrency tuning has no effect on buffer capacity or return-address corruption. The HTTP connection count controls concurrency at a separate layer. Even one malicious request carrying a username longer than the buffer can trigger the same unsafe write irrespective of how many clients are allowed.
E:Restarts hide symptoms while the same memory-safety defect remains exploitable. Restarting after a crash might restore availability briefly, but a repeat input can hit the identical bug again. Suppressed alerts also remove warning evidence about active exploit attempts while leaving possible code execution risk intact.
Question 84
A privileged helper reads untrusted text from a plug-in and later interprets it as an operating-system command. Attackers can supply command separators in that text. What change closes the execution boundary?
- Encrypt its log files while leaving command concatenation unchanged.
- Expand the shell PATH to include more external utilities.
- Pass validated values through a non-shell API with fixed allowed operations.
- Escape shell metacharacters in one plug-in field while continuing to concatenate other plug-in values into a privileged shell command.
Explanation
Correct Answer
C:Data cannot become arbitrary shell syntax when no interpreter receives attacker-controlled command fragments. A structured API with fixed operations keeps the plug-in's values in typed arguments rather than concatenated shell syntax. The helper can then authorize each requested operation before executing it with elevated privileges.
Incorrect Answers
A:Log confidentiality cannot stop malicious bytes from becoming privileged execution instructions. Encrypting event files protects recorded output from unauthorized storage access, not the helper's command-construction boundary. Attackers can still supply separators that become additional instructions when the privileged process invokes the shell.
B:A larger executable search path gives injected command strings additional programs to invoke. A broader executable search path may make attacker-chosen command names resolve to even more programs. It neither validates the plug-in's text nor prevents a shell interpreter from treating inserted metacharacters as control syntax.
D:Escaping a single input field may reduce one payload form but leaves the fundamental shell-concatenation boundary open through other untrusted values or quoting cases. The privileged helper should invoke a fixed set of operations through an argument-safe, non-shell API and validate each parameter. Security must not depend on one incomplete blacklist of command separators.
Question 85
A server checks that a temporary file is safe, but later opens it by the same path after an untrusted process can replace the directory entry. Select TWO changes that eliminate the time-of-check/time-of-use race.
- Recheck the pathname's owner and permissions immediately before opening it, using a separate pathname-based system call.
- Use atomic filesystem primitives and appropriate no-follow flags for create or update steps.
- Increase the delay between file validation and opening.
- Record only the pathname in an audit log after the operation.
- Open the target safely once and perform validation and subsequent operations through the retained file descriptor.
Explanation
Correct Answers
B:Atomic operations narrow the opportunity for symlink substitution between a check and protected use. Atomic operations combine an important state change into a single filesystem operation, reducing opportunities to redirect it through a swapped link. Appropriate no-follow flags prevent certain symlink traversals, though permissions and error handling still matter.
E:The retained handle refers to the same object even if another process later changes the directory entry. Validating and using the same safely obtained file descriptor binds both steps to one opened object despite later directory-entry changes. The process must also use secure open flags and verify object attributes before privileged operations.
Incorrect Answers
A:Checking ownership and permissions is sensible when handling temporary files, but this second check is still separate from the eventual open. The untrusted process can swap the directory entry after that recheck and before use, leaving the same race window. Atomically obtaining and retaining a safe file handle is necessary to eliminate the path substitution.
C:A larger window gives the attacker more time to swap the file or link after the check. Introducing delay makes the gap between validation and use more predictable and exploitable. An attacker can replace the directory entry during that window, so the original check does not apply to the later object.
D:The string does not prove which file object was opened when an attacker could alter the path's target. A pathname is a name that may refer to different objects at two points in time. Recording it afterward does not establish inode identity or guarantee that the privileged operation touched the file previously inspected.
Question 86
An API accepts a serialized object from the internet and reconstructs it with a library that runs special constructors during decoding. What defensive design avoids granting submitted bytes that behavior?
- Increase decoder recursion limits for complex input.
- Store the request body in a log after running its constructor methods.
- Allow every object type as long as the request used HTTPS.
- Parse an explicit allowlisted data schema without invoking arbitrary object instantiation hooks.
Explanation
Correct Answer
D:Restricted types prevent attacker-supplied object metadata from triggering unexpected code during deserialization. Parsing into an explicitly defined schema treats incoming fields as data with expected types and bounds. Avoiding arbitrary class reconstruction prevents untrusted object metadata from selecting unexpected constructors, callbacks or dangerous gadget chains.
Incorrect Answers
A:Looser limits can enlarge the attack surface while retaining the dangerous object-construction behavior. Permitting deeper object nesting can consume additional resources while preserving gadget and constructor execution. The dangerous property is code invoked during decoding of attacker-selected types, not the maximum recursion depth alone.
B:Logging after execution cannot prevent code that has already run with server privileges. A log entry written after invoking constructors is too late to prevent malicious side effects. Deserialization may already have executed methods with server identity, modified files or made outbound connections before logging begins.
C:Transport confidentiality does not make the payload's constructors or gadget chain safe to execute. HTTPS confirms protected delivery to the service endpoint; it does not certify the semantic safety of the serialized bytes. Attackers can submit malicious objects through a perfectly valid encrypted connection.
Question 87
A supplier ships a tested security fix for a server privilege-escalation defect that is reachable on current hosts. What action directly eliminates the known vulnerable code?
- Change the incident ticket severity without touching the servers.
- Block security update verification to reduce deployment time.
- Stage and deploy the vendor's remediation, then confirm the fixed build on affected hosts.
- Copy the vulnerable image to a second host for redundancy.
Explanation
Correct Answer
C:Installing the corrected code removes the known privilege-escalation path rather than only observing exploitation attempts. Stage deployment to account for service dependencies, install the vendor correction, and verify the running package or build version on each affected host. That evidence distinguishes completed remediation from an approved change ticket.
Incorrect Answers
A:Reporting priority cannot repair the exploitable operating-system routine. Increasing the ticket's priority can improve coordination but does not alter the vulnerable executable code on any current server. The known privilege-escalation path remains available until the affected component is actually remediated.
B:Bypassing package authenticity increases supply-chain risk and undermines confidence in the intended fix. Skipping vendor signature or package verification creates a new path for a malicious or altered update. Administrators need confidence that the intended fix is authentic before distributing privileged software across production hosts.
D:Replicating an affected version creates another instance of the same privilege-escalation exposure. A second host running the identical vulnerable build duplicates the exploit surface rather than eliminating it. Redundancy may improve availability, but attackers can target both systems through the same privilege-escalation defect.
Question 88
A cloud analytics role contains a wildcard permission allowing writes to every production storage bucket, though its job uses one report prefix. Which IAM change follows least privilege?
- Require a particular cloud region for the role but retain wildcard write rights over all production buckets in that region.
- Permit only required object operations on the designated reporting prefix.
- Keep global bucket write access because the role is in a trusted cloud account.
- Rotate the cloud analytics role's access keys but preserve its wildcard write permission to all production buckets.
Explanation
Correct Answer
B:Task-specific action and resource restrictions remove the role's ability to overwrite unrelated production data. Restrict the permitted API verbs and resource patterns to the report prefix that the analytics job actually needs. A compromised or buggy job then cannot overwrite other production datasets merely because it belongs to a trusted account.
Incorrect Answers
A:A region condition narrows where requests can originate or be targeted, but it does not bind write authority to the role’s one reporting prefix. Other buckets in the allowed region would still accept destructive or unauthorized writes. Least privilege requires reducing the permitted object actions and resource ARNs to the specific reporting path used by the analytics job.
C:Account membership does not justify unrelated write permissions across many protected storage resources. Account membership establishes administrative context but is not a business justification for global writes. Least privilege limits the consequences of mistakes or stolen runtime credentials to the minimal reporting objects and operations.
D:Credential rotation can limit the useful lifetime of a previously copied access key, so it is a reasonable identity safeguard. It does not reduce what the role is allowed to change if the new key is used legitimately or stolen. The question targets excessive scope; least privilege requires prefix-specific object write operations.
Question 89
A contractor without corporate identity can download internal financial PDFs from a cloud object endpoint. The owner never intended public sharing. What immediate authorization defect should be removed?
- Encrypt stored objects while preserving the public read permission.
- Restrict the cloud role used to upload reports while leaving the object bucket policy publicly readable.
- Set a longer lifecycle retention period on the PDFs.
- Remove public principals from the object-access policy and test unauthenticated requests for denial.
Explanation
Correct Answer
D:Permission changes close the live exposure and a negative read test verifies that an outsider can no longer fetch files. Remove anonymous and broad public principals at the bucket and object policies, then test the actual endpoint without credentials. A negative read test proves that the effective authorization boundary changed rather than only a visible console setting.
Incorrect Answers
A:Transparent server-side encryption still serves plaintext to identities authorized by the bucket policy. Server-side encryption is normally transparent to callers whom the object service authorizes. When an anonymous principal still has read permission, the cloud service can decrypt and return the financial PDF without the caller holding storage keys.
B:A narrow uploader role reduces authorized writers but cannot override a public-read resource policy. In this incident, a contractor without corporate identity can retrieve the financial PDF because public principals can read it. The remediation must deny unauthenticated object retrieval at the bucket or object policy and then validate denial from an external session.
C:Keeping files longer does not change whether the anonymous principal can read them. Retention settings control how long objects persist but do not remove their current read permissions. Longer retention may actually extend the window in which unauthorized outsiders can download sensitive financial material.
Question 90
A browser sends authentication cookies to an older HTTP endpoint on an internal portal. Someone observing the local network could read the request. Which application transport protection is required?
- Redirect to authenticated TLS and set session cookies to Secure so they are not sent over HTTP.
- Store passwords in a faster database index only.
- Set the cookies to HttpOnly and SameSite but leave the portal reachable by unencrypted HTTP carrying those cookies.
- Compress HTTP responses more aggressively.
Explanation
Correct Answer
A:Encryption protects the session in transit and the cookie flag blocks plaintext leakage on legacy endpoints. Both the transport and cookie flags matter: TLS protects the request contents in transit, while Secure prevents the session cookie from being attached to subsequent plaintext HTTP requests. Existing sessions should be retested against legacy links.
Incorrect Answers
B:Faster queries have no impact on whether session cookies travel in plaintext on the network. Database indexing accelerates backend queries but does not encrypt browser-to-server requests. A packet observer on the local network can still read the cookie in an HTTP header irrespective of password-storage performance.
C:HttpOnly reduces direct JavaScript access to a cookie, and SameSite constrains some cross-site request scenarios. Neither prevents an on-path observer from reading a cookie included in plaintext HTTP traffic. The stated failure is transport disclosure, so authenticated HTTPS plus the Secure cookie attribute must prevent the browser sending session tokens over HTTP.
D:Smaller payloads remain readable to a packet observer when no transport encryption exists. Compression changes transfer size but not the confidentiality property of an unencrypted request. An observer who captures the HTTP message can still recover its session identifier after decompressing the traffic.
CompTIA Security+ (SY0-701) Practice Tests