Limited-Time Offer: Enjoy 50% Savings! - Ends In 0d 10h 22m 48s Coupon code: 50OFF

Exam Details

Exam Code
CAP
Vendor
The SecOps Group
Question Types
Single Choice
Official Page
View Exam Page
1

Input Validation Mechanisms

Input validation mechanisms determine which submitted values an application accepts or rejects. Candidates must choose validation rules that match the permitted input, including when an allowlist is more reliable than a denylist.

Question 1 of 46 Single Choice

A reporting application offers a locale selector that sends a locale tag to the server. The product requirement permits exactly en-US, fr-FR, and de-DE, and the service must reject all other values. An older validation routine blocks a short list of punctuation marks, but the team has found that other well-formed locale tags are accepted. The validation must preserve the exact supported values and reject unsupported ones.

Which validation change best meets the requirement?

Show Answer

Correct Answer

B

Option B is correct because an exact allowlist accepts only the three locale tags the application supports. Option A is not correct because unlisted locale values can still pass. Option C is not correct because it accepts correctly shaped but unsupported tags. Option D is not correct because it changes case and accepts any five-character value.

Question 2 of 46 Single Choice

A warehouse scheduling service receives a pallet count in a JSON request. The business rule allows only whole numbers from 1 through 240, inclusive, and requests can be sent by both the web page and a partner client. The current server check only rejects empty input and a short list of known letters. The team needs a validation rule that consistently rejects malformed values and values outside the allowed range.

Which server-side validation approach should the team use?

Show Answer

Correct Answer

B

Option B is correct because strict digit validation, integer parsing, and a server-side range check enforce the stated pallet-count limits. Option A is not correct because it does not establish the permitted range or a strict integer representation. Option C is not correct because requests can bypass browser controls. Option D is not correct because a denylist does not reliably define valid numeric input.

2

Cross-Site Scripting

This topic covers how cross-site scripting can occur when browsers interpret untrusted content as executable markup or script. Candidates must identify unsafe rendering contexts and select appropriate output handling or DOM APIs to prevent execution while meeting application requirements.

Question 3 of 46 Single Choice

A customer support portal displays search results on a page that repeats the submitted search term in a paragraph. The search value is copied directly into the HTML response by a template helper that disables automatic escaping. A tester demonstrates that crafted markup in the search value is interpreted by the browser. The team must retain the search feature and display ordinary search terms unchanged.

Which change best prevents the reflected cross-site scripting flaw while preserving the search term as visible text?

Show Answer

Correct Answer

A

Option A is correct because the search term is inserted into an HTML text context, so HTML encoding prevents characters such as angle brackets from being interpreted as markup. Option B uses the wrong output context. Option C is for URL components, not HTML text. Option D may reduce some impact, but it does not correct the unsafe output operation.

Question 4 of 46 Single Choice

An internal reporting dashboard reads a filter value from the URL fragment and inserts it into a results panel using the browser's innerHTML property. The server never receives the fragment, and the page must continue to show the selected filter as text. A security review confirms that crafted fragment content can create browser-interpreted markup. The developers want a small change to the rendering code.

Which change best addresses the cross-site scripting flaw in this client-side rendering flow?

Show Answer

Correct Answer

A

Option A is correct because textContent treats the fragment as text rather than parsing it as HTML, which directly removes the unsafe DOM sink in this flow. Option B encodes for a URL component, not an HTML parsing context. Option C misses other executable markup. Option D does not help because the fragment is read and processed in the browser.

Question 5 of 46 Single Choice

A community site stores comments and displays them to other members on discussion pages. The product requirement allows basic formatting such as emphasis and links, so rendering every comment as plain text is not acceptable. A review finds that comments are rendered as HTML without sanitization, and a crafted comment can execute in a viewer's browser. The team needs to preserve only approved formatting.

Which approach best prevents stored cross-site scripting while retaining the permitted formatting?

Show Answer

Correct Answer

B

Option B is correct because a suitable HTML sanitizer can retain the permitted formatting while removing unsafe elements and attributes before the comment is rendered as HTML. Option A misses executable markup beyond script tags. Option C prevents markup but also removes the required formatting. Option D is a supplementary control and does not make unsafe stored content safe to render.

3

SQL Injection

This topic covers how SQL injection occurs when data supplied by a user changes the structure of a database query. Candidates must recognize unsafe query construction and select ways to bind values as data rather than executable SQL.

Question 6 of 46 Single Choice

A Java service uses JDBC to search a product catalog by a phrase entered in a web form. The service builds a SELECT statement by appending the phrase between single quotation marks, then sends the completed string to the database. Search terms may contain spaces and punctuation, and the application must retain its existing search behavior. A security review confirms that input can alter the query structure.

Which change best prevents SQL injection while preserving the search behavior?

Show Answer

Correct Answer

A

Option A is correct because the JDBC PreparedStatement binds the search term as data, so SQL syntax supplied in the term is not executed as part of the query. Option B can miss other SQL syntax and encoding cases. Option C does not reliably neutralize SQL syntax. Option D preserves the unsafe concatenation inside the stored procedure.

Question 7 of 46 Single Choice

A SQL Server application calls a stored procedure to create a customer report. The procedure accepts a customer identifier and a sort direction, then builds a statement by concatenating both values into a string before executing it with EXEC. The report must continue to support ascending and descending order. A review shows that the customer identifier comes from a request and can contain SQL syntax.

Which modification most directly prevents SQL injection in this procedure while retaining the dynamic sort direction?

Show Answer

Correct Answer

A

Option A is correct because sp_executesql can bind @customerId as data, while the procedure can retain its required sort direction. Option B still constructs SQL from the parameter and does not safely bind it. Option C uses sp_executesql without parameterization. Option D is incorrect because converting a value to text does not prevent injected SQL syntax.

4

XML External Entity attack

This topic covers how XML parsers can process external entity declarations in submitted documents. Candidates must recognize the resulting risk and select parser controls that prevent unsafe external entity resolution.

Question 8 of 46 Single Choice

A Java invoice service uses a DOM parser to process XML supplied by several business partners. The accepted invoice format does not require DTD declarations, but a security test shows that a submitted document can declare an external entity and include the contents of a server file in the processing result. The team wants to block this parser behavior without replacing the invoice format.

Which parser change most directly prevents the attack while preserving support for ordinary XML documents that do not require a DTD?

Show Answer

Correct Answer

A

Option A is correct because rejecting DOCTYPE declarations prevents submitted XML from defining external entities. Option B is not correct because disabling expansion in the document tree does not reliably prevent external resource resolution. Option C is not correct because XInclude is separate from DTD entity processing. Option D is not correct because other DTD processing paths may remain available.

Question 9 of 46 Single Choice

An internal document-import endpoint accepts XML reports from a controlled set of partner systems. During a test, a report declares an external entity that refers to a local configuration file, then uses that entity in a report field. The endpoint returns a parsed report containing text from that file. The response is stable across repeated tests, and server memory use remains normal.

Which parser behavior best explains the observed result?

Show Answer

Correct Answer

A

Option A is correct because the document's external entity refers to a local file, and the parser inserts the resolved text where the entity is used. Option B is not correct because entity expansion exhaustion would cause resource strain, not return the specific file contents. Option C is not correct because the document uses an entity declaration, not an XInclude element. Option D is not correct because processing instructions do not explain this entity substitution.

5

Cross-Site Request Forgery

Cross-Site Request Forgery occurs when a browser sends an unwanted request to a site where the user is already signed in. Candidates must recognize this risk and select server-side controls that verify a state-changing request came from an intended interaction.

Question 10 of 46 Single Choice

A customer portal uses a server-side session cookie to keep users signed in. The email-change form submits a POST request, and the server checks that the new address is syntactically valid. A review finds that a page hosted on another site could cause a signed-in user's browser to submit the same request. The portal has no external clients that need to call this form endpoint.

Which change most directly prevents a page on another site from submitting an unwanted email-change request?

Show Answer

Correct Answer

A

Option A is correct because a session-bound token lets the server distinguish the user's intended form submission from a cross-site request that lacks the token. Option B is not correct because another site can submit a POST form. Option C is not correct because the request has already changed the address. Option D is not correct because format checking does not establish that the user intended the change.

Question 11 of 46 Single Choice

An internal project portal lets employees approve release plans through browser-submitted POST requests. The endpoints use session cookies, and the security team has confirmed that no mobile application, partner, or command-line client calls them. Browsers used by employees send an Origin header on these requests. The portal currently processes requests without checking that header, and approvals must remain available to users on the portal itself.

Which server-side check best addresses the cross-site request risk for these browser-only state-changing requests?

Show Answer

Correct Answer

A

Option A is correct because the portal serves only browser clients, so it can reject state-changing requests whose Origin does not match its own. Option B is not correct because blocking response reads does not necessarily prevent a cross-site request from being sent. Option C is not correct because an attacker can submit a POST form. Option D is not correct because input checks do not verify request origin.

6

Encoding, Encryption and Hashing

This topic covers how encoding, encryption, and hashing transform data and what each method can and cannot provide. Candidates must select the appropriate method for representing data, protecting confidentiality, or checking integrity.

Question 12 of 46 Single Choice

A records team is moving confidential archive files to a shared storage service. Approved staff must be able to restore each file later, but storage operators must not be able to read the contents. The team also wants the application to detect changes to stored ciphertext. Keys can be kept in a managed key service, and each file is encrypted separately.

Which approach best meets the archive requirements?

Show Answer

Correct Answer

C

Option C is correct because AES-GCM provides reversible encryption and detects changes, while the managed key supports authorized recovery. Option A is not correct because Base64 changes representation but provides no confidentiality. Option B is not correct because a digest cannot recover the archive. Option D is not correct because ECB does not provide authenticated encryption and can expose patterns.

Question 13 of 46 Single Choice

A research office restores weekly data files from a storage system that sometimes suffers silent corruption. A separate, access-controlled service retains a digest for each original file, and staff need only determine whether restored bytes match those originals. The files are not secret, and the check must not depend on decrypting data or on a shared secret key.

Which method should the service use to check whether each restored file matches the version recorded in the protected manifest?

Show Answer

Correct Answer

C

Option C is correct because comparing the file's SHA-256 digest with the independently protected manifest digest detects a mismatch without needing to recover or conceal the file. Option A is not correct because encoding does not provide a cryptographic integrity check. Option B is not correct because encryption is not the requested comparison method. Option D is not correct because MD5 is not a suitable modern cryptographic hash.

Question 14 of 46 Single Choice

A document-processing service sends binary thumbnails to a downstream component through a JSON-only interface. The receiving component must reconstruct the exact original bytes, and the thumbnails are already approved for public access. The interface rejects raw binary values, while both components can use standard Base64 libraries. No confidentiality or integrity control is required for this transfer.

Which transformation should the service apply before placing the payload in the JSON field?

Show Answer

Correct Answer

A

Option A is correct because Base64 represents arbitrary binary bytes as text that can be placed in the JSON field and decoded back to the original bytes. Option B is not correct because encryption adds key-management requirements and prevents recovery if the key is discarded. Option C is not correct because a digest cannot reconstruct the payload. Option D is not correct because arbitrary binary bytes are not necessarily valid UTF-8 text.

7

Authentication related Vulnerabilities

This topic covers weaknesses in login controls, password policies, and the handling of stored credentials. Candidates must assess how attackers guess passwords and select controls and password requirements that reduce this risk.

Question 15 of 46 Single Choice

A company portal has a single password-based login for employees and currently permits unlimited attempts. The security team has recorded thousands of failed attempts against one employee account, each from a different source address. The company cannot require a new authentication factor this quarter, and its support team cannot handle frequent manual account unlocks.

Which change best addresses the attack while avoiding an easy denial of access to the employee?

Show Answer

Correct Answer

B

Option B is correct because per-account progressive delays remain effective when attempts come from many addresses, without creating a permanent lockout. Option A is not correct because permanent disablement lets an attacker deny access to the employee. Option C is not correct because distributed sources evade an IP-only threshold. Option D is not correct because a CAPTCHA alone does not reliably limit repeated password guesses.

Question 16 of 46 Single Choice

An employee portal currently requires eight-character passwords with uppercase letters, digits, and symbols, and forces a reset every 30 days. Helpdesk records show that many employees make small predictable changes to the same password each month. The application accepts spaces and passwords up to 64 characters, supports password-manager paste, and can compare new passwords with a maintained list of common and compromised choices.

Which password policy change best addresses the observed user behavior while improving resistance to password guessing?

Show Answer

Correct Answer

B

Option B is correct because the application accepts long passphrases and can screen known-compromised choices, while the exception-based change rule avoids routine resets that staff have begun to vary predictably. Option A is not correct because composition rules and frequent resets encourage predictable substitutions. Option C is not correct because the 12-character cap blocks longer passphrases. Option D is not correct because an eight-character minimum remains inadequate.

8

Understanding of OWASP Top 10 Vulnerabilities

This topic covers how the OWASP Top 10 groups common application security risks and how to interpret its categories. Candidates must recognize what the list can indicate and avoid treating it as proof that every application risk has been assessed.

Question 17 of 46 Single Choice

A payment platform team investigates a series of suspicious account exports. The application allowed each export as designed, but it recorded no application events for these actions and generated no alerts for the unusual sequence. The team learned about the activity only after a customer complaint and cannot establish when the exports occurred or which records were affected.

Which OWASP Top 10 2021 category best describes the primary weakness?

Show Answer

Correct Answer

A

Option A is correct because missing application event records and absent alerts prevent the team from detecting and investigating activity, which matches Security Logging and Monitoring Failures in the 2021 OWASP Top 10. Option B is not correct because the scenario does not describe insecure deployment settings. Option C is not correct because there is no evidence of an authentication failure. Option D is not correct because no software integrity problem is described.

Question 18 of 46 Single Choice

A software organization requires teams to complete a review before releasing a new customer portal. One team reports that it checked every category in the OWASP Top 10 and proposes treating that result as complete evidence that the portal has no significant security risks. The release process also requires attention to the portal's specific features and data, but the team has not included those factors in its review.

Which conclusion about the OWASP Top 10 is most appropriate?

Show Answer

Correct Answer

A

Option A is correct because the team has checked only the OWASP Top 10 categories, while its own requirements and threat context may include risks that the list does not establish as covered. Option B is not correct because the Top 10 is not an exhaustive acceptance checklist. Option C is not correct because it does not prescribe language-specific coding rules. Option D is not correct because category order is not an incident severity score.

9

Security Best Practices and Hardening Mechanisms.

This topic covers browser same-origin controls and response headers that restrict how a web application can be accessed or embedded. Candidates must choose policies that meet application requirements while limiting access to trusted origins.

Question 19 of 46 Single Choice

A company runs a browser-based reporting interface at https://reports.example.com and an API at https://api.example.com. The interface must read reports using the employee's existing browser session, but no other website should be able to read API responses through a browser. Requests from the interface currently fail after credentials are enabled, and the team wants the narrowest standards-based cross-origin policy without changing either host.

Which response configuration best meets the requirements?

Show Answer

Correct Answer

B

Option B is correct because the API can name the reporting interface's exact origin, allow credentialed browser requests, and mark the response as origin-dependent for caches. Option A is rejected by browsers for credentialed CORS, while Option C uses an invalid wildcard subdomain value. Option D leaves the Same Origin Policy in force, so the interface cannot read the API response.

Question 20 of 46 Single Choice

A customer dashboard at https://portal.partner.example embeds a status console hosted at https://status.example.net. The console must also remain usable when opened directly, and it must be frameable only by itself or the named customer portal. Other origins must not embed it. The team needs a response-level browser control and cannot remove the partner's existing embedded workflow.

Which response policy should the console use?

Show Answer

Correct Answer

B

Option B is correct because frame-ancestors permits the console itself and the named partner portal while excluding other framing origins. Option A is not correct because default-src does not serve as a fallback for frame-ancestors. Option C blocks the required partner, and Option D permits only same-origin framing.

10

TLS security

This topic covers TLS certificate validation and cipher-suite configuration. Candidates must identify certificate identity problems and match supported cipher suites to client and server requirements.

Question 21 of 46 Single Choice

A public API is reached through a load balancer at api.example.net. After a DNS migration, several clients report TLS hostname verification errors. The load balancer presents a currently valid certificate issued by a trusted authority, but its subject alternative name lists only legacy.example.net. The team must keep hostname verification enabled and avoid changes to client trust stores.

What should the team change to correct the TLS identity failure?

Show Answer

Correct Answer

B

Option B is correct because the presented certificate does not include the hostname clients request, so the service needs a certificate valid for api.example.net with a trusted chain. Option A is not correct because trusting the issuer does not resolve a hostname mismatch. Option C is not correct because accepting a different hostname weakens identity verification. Option D is not correct because disabling verification removes this protection.

Question 22 of 46 Single Choice

An internal service uses TLS 1.2 and presents an ECDSA certificate. Its configuration currently offers only TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384. A partner client can use only TLS 1.2 and offers TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256. The service owner must preserve TLS 1.2, keep forward secrecy, and select a configuration that has a suite in common with the client.

Which server-side change is most appropriate to allow a secure TLS 1.2 handshake with this client?

Show Answer

Correct Answer

A

Option A is correct because the client supports that TLS 1.2 suite, which uses ECDSA authentication and AES-GCM encryption, matching the server certificate and the client's offer. Option B is not correct because the client does not support the server's ECDHE_RSA suite. Option C is not correct because the client does not offer that RSA suite. Option D is not correct because the client supports only TLS 1.2.

11

Server-Side Request Forgery

This topic covers server-side request forgery, where an application is induced to make requests to unintended destinations. Candidates must recognize how fetch features can expose internal services and select controls that restrict outbound requests.

Question 23 of 46 Single Choice

A support portal generates previews by having its backend retrieve a URL supplied by a signed-in user. The feature must continue retrieving public websites, but an internal assessment found that the backend can reach a cloud metadata service and internal administration hosts. The team can change network rules and the fetch service, but cannot remove the preview feature.

Which control best meets the requirement while limiting the impact of server-side request forgery?

Show Answer

Correct Answer

B

Option B is correct because the service needs public access, and outbound network rules can block internal and metadata destinations even when an attacker changes the URL or uses a redirect. Option A can be bypassed with an IP address or another hostname. Option C limits file access but not network access. Option D does not prevent an authenticated user from exploiting the fetch feature.

Question 24 of 46 Single Choice

A media service retrieves images from partner sites, and those sites sometimes redirect to their content delivery networks. The service currently follows redirects automatically. During testing, an attacker-controlled public site redirected the service to an internal status endpoint. The business requires legitimate public redirects to keep working, and the team wants to stop the internal request before it is sent.

Which change best prevents the fetcher from reaching an internal service through a redirect while retaining support for legitimate public redirects?

Show Answer

Correct Answer

C

Option C is correct because each redirect can change the destination, so the fetcher must assess the next destination before making that connection. Option A checks only the first destination and leaves later hops unchecked. Option B learns the destination after the request has already reached it. Option D protects the initial transport but does not constrain where a redirect leads.

Question 25 of 46 Single Choice

A reporting application accepts a hostname and checks that its DNS answer is public before fetching a report. The HTTP library then performs its own DNS lookup when it opens the connection. An assessment showed that a test hostname could return a public address during the check and a private address during the later lookup. The application must keep retrieving public hostnames.

Which change most directly closes the DNS rebinding gap in this fetch workflow?

Show Answer

Correct Answer

A

Option A is correct because the proxy checks the resolved destination and uses that same address for the connection, preventing a second lookup from changing the target. Option B does not ensure that the checked address is the one used. Option C relies on hostname wording and misses other names. Option D repeats the vulnerable lookup and checks only one possible result.

12

Authorization and Session Management related flaws

This topic covers authorization failures such as IDOR and privilege escalation caused by client-controlled parameters, along with session cookie protections. Candidates must identify where access checks belong and select cookie settings that enforce the intended session behavior.

Question 26 of 46 Single Choice

A billing portal lets customers download invoices through a URL containing an invoice number. Support staff have confirmed that customers should see only invoices assigned to their own accounts. A tester changed the number in the URL and received another customer's invoice, although the portal interface displayed only the logged-in customer's invoice list. The download endpoint currently checks that the customer has an active session but does not check invoice ownership.

Which change best prevents one customer from retrieving another customer's invoice?

Show Answer

Correct Answer

C

Option C is correct because the server must verify ownership of the requested invoice for each request, including when a customer changes the invoice identifier. Option A is not correct because hidden identifiers can still be discovered or submitted directly. Option B makes guessing harder but does not enforce access rights. Option D relies on a header that is not a reliable authorization control.

Question 27 of 46 Single Choice

A service dashboard uses one endpoint for staff and customer accounts. The browser hides staff controls from customers, but a request to change an account setting includes an accessLevel parameter. During testing, a customer changed that parameter from customer to manager and the server accepted a manager-only change. The team needs a remediation that preserves the shared endpoint and does not rely on the browser interface.

Which remediation best prevents a customer from gaining manager privileges by changing the request?

Show Answer

Correct Answer

D

Option D is correct because the server must use its trusted permission data to decide whether the caller may perform each manager-only operation, rather than accepting a client-supplied access level. Option A only changes the interface. Option B obscures the parameter but does not stop modification. Option C changes the representation, not the authority of the value.

Question 28 of 46 Single Choice

An internal scheduling application sets its session cookie after a user signs in through an HTTPS page. The cookie currently has HttpOnly and SameSite attributes but lacks Secure. A legacy route on the same host still accepts HTTP connections, and the browser can include the session cookie when a user visits that route. The team must ensure that the browser does not transmit the session cookie over an unencrypted connection.

Which cookie attribute should the team add to meet the requirement that the session cookie is never sent over an unencrypted HTTP connection?

Show Answer

Correct Answer

B

Option B is correct because the Secure attribute restricts the browser to sending the session cookie over HTTPS, which meets the stated transport requirement. Option A limits access to the cookie through browser scripts but does not restrict HTTP transmission. Option C controls cross-site cookie sending behavior. Option D sets a lifetime and does not determine which connection may carry the cookie.

13

Insecure File Uploads

This topic covers risks created when applications accept and store files from users. Candidates must be able to select controls that prevent uploaded content from being executed and ensure that file storage handles separate submissions safely.

Question 29 of 46 Single Choice

A support portal accepts files for customer reports and saves them in a directory beneath the web root. The production server has a PHP handler enabled for that directory. Users must still be able to retrieve submitted files later, and the team has confirmed that an attacker can submit a file containing PHP code.

Which change best addresses the execution risk while allowing users to retrieve uploaded files?

Show Answer

Correct Answer

A

Option A is correct because storage outside the document root, with execution disabled, prevents uploaded PHP from running through a web request while allowing application retrieval. Option B is not correct because changing an extension does not neutralize executable content. Option C is not correct because the client can forge Content-Type. Option D is not correct because obscuring a URL does not disable server-side execution.

Question 30 of 46 Single Choice

The support portal stores uploaded customer invoices in a shared directory and uses the original client filename as the destination name. Two customers have independently uploaded files named invoice.pdf, and the later upload replaces the earlier file. Staff need every submission retained, while the original name must remain available for support workflows.

Which storage change best prevents this collision while retaining the original name for staff?

Show Answer

Correct Answer

B

Option B is correct because a unique server-generated identifier gives each submission a distinct storage name, while separate metadata preserves the original name for staff. Option A is not correct because it prevents a later legitimate submission from being retained under the same name. Option C is not correct because client-supplied timestamps can repeat. Option D is not correct because many files share those values.

14

Code Injection Vulnerabilities

This topic covers weaknesses that let untrusted input become executable code in an application. Candidates must recognize unsafe code evaluation and select designs that provide the required behavior without executing attacker-controlled code.

Question 31 of 46 Single Choice

A Node.js service lets customers set simple pricing formulas using addition, subtraction, multiplication, and division. The current implementation concatenates each submitted formula into a string passed to new Function. Customers need to keep using formulas, but the service must not execute arbitrary JavaScript, and the team cannot add a third-party expression engine.

Which design change best meets the stated requirement while preventing execution of attacker-supplied code?

Show Answer

Correct Answer

B

Option B is correct because a restricted parser can support the required arithmetic without treating the submitted formula as JavaScript code. Option A is not correct because escaping selected characters does not reliably prevent code execution. Option C is not correct because the vm module is not a security boundary. Option D is not correct because it still executes attacker-controlled code in the browser.

Question 32 of 46 Single Choice

A Java service uses GroovyShell.evaluate to run rules supplied by tenants. The rules need to compare order totals with thresholds and calculate a percentage adjustment, but they do not need loops, method calls, or access to Java classes. The service processes many tenants in one application instance, and the team must prevent a tenant rule from executing arbitrary code.

Which change best preserves the required rule capability while preventing untrusted input from being executed as code?

Show Answer

Correct Answer

C

Option C is correct because the constrained rule interpreter permits the required comparisons and arithmetic without compiling tenant input as Groovy code. Option A is not correct because process isolation limits impact but still executes the injected code. Option B is not correct because bindings alone do not restrict Groovy language capabilities. Option D is not correct because encoding does not make evaluated code safe.

15

Business Logic Flaws

This topic covers flaws in application rules and transaction workflows that allow users to obtain outcomes the business did not intend. Candidates must analyze how business operations are performed and select controls that enforce the correct calculations, sequence, and transaction results.

Question 33 of 46 Single Choice

An online retailer calculates cart totals in the browser so that customers see price updates without reloading the page. At checkout, the browser sends item identifiers, quantities, an applied promotion code, and a total amount. The server checks that the identifiers exist, but it currently charges the submitted total. The retailer must preserve its existing promotion rules while preventing customers from changing the amount charged.

Which change best prevents the customer from paying an amount below the server-calculated order price?

Show Answer

Correct Answer

A

Option A is correct because the server must derive the charge from authoritative prices and discount rules, rather than trust the customer's submitted total. Option B still permits a customer to submit an artificially low amount. Option C does not prevent requests from being modified. Option D compares two values that the customer can control.

Question 34 of 46 Single Choice

A retailer allows customers to apply a gift card to online orders. The checkout service reads the card balance, creates an order, and deducts the amount in a later step. During a busy sale, two checkout requests can arrive almost together for the same card. Each request may read the original balance, and the retailer must ensure that completed orders never consume more than the card holds.

Which design best prevents two simultaneous orders from spending the same gift card balance?

Show Answer

Correct Answer

C

Option C is correct because the balance check, deduction, and redemption record must operate atomically, so concurrent orders cannot both use the same funds. Option A leaves a gap in which both orders can pass the check. Option B delays the deduction until after confirmation. Option D can let concurrent requests use a stale balance.

Question 35 of 46 Single Choice

A ticketing service sends customers to an external payment provider and then returns them to a success page. Its current application marks an order as paid when the browser reaches that page, and staff then release the tickets automatically. Some customers report that tickets were issued even though their payment was later declined. The service needs to keep automatic fulfillment while ensuring payment is confirmed for the correct order.

Which change best prevents an order from being fulfilled before payment has actually been confirmed?

Show Answer

Correct Answer

C

Option C is correct because fulfillment depends on trusted confirmation that the payment matches the specific order and amount. Option A relies on a browser redirect, which can occur without confirmed payment. Option B trusts a client-controlled status. Option D adds another customer action but does not establish that payment succeeded.

16

Directory Traversal Vulnerabilities

This topic covers how crafted file paths can cause an application to access files outside an intended directory. Candidates must reason about resolved paths and enforce directory boundaries when applications open files.

Question 36 of 46 Single Choice

A reporting service stores files under `/srv/reports` and accepts a relative filename for a download request. The service normalizes the joined path and checks that it appears to remain under the reports directory. An administrator has also created an `archive` symlink inside that directory, and it points to `/var/private`. Only files physically within `/srv/reports` may be returned.

Which change best prevents the described directory traversal?

Show Answer

Correct Answer

A

Option A is correct because resolving real paths reveals that the `archive` symlink leads outside `/srv/reports`, and path-aware containment can reject it. Option B can miss alternate traversal forms. Option C checks a string rather than the resolved target. Option D can introduce traversal sequences and does not establish that the file is inside the permitted directory.

Question 37 of 46 Single Choice

A documentation service serves existing files from `/opt/app/manuals` and must support valid nested paths such as `release/v3/guide.pdf`. Its current check compares the requested path string with the root string using a prefix test. A neighboring directory named `/opt/app/manuals-old` contains internal files, and requests must never reach that directory or any other path outside the manuals tree.

Which path check should the service use to enforce the directory boundary?

Show Answer

Correct Answer

C

Option C is correct because path-component-aware containment distinguishes the manuals directory from a sibling such as `/opt/app/manuals-old`, while still allowing valid nested files. Option A can reject harmless names without proving containment. Option B accepts sibling paths with the same string prefix. Option D blocks the required nested manual structure.

17

Security Misconfigurations.

This topic covers deployment and runtime settings that expose unnecessary capabilities or create unsafe application behavior. Candidates must identify the misconfiguration in a realistic setup and select a direct configuration change that addresses it.

Question 38 of 46 Single Choice

A media-processing service runs in a Docker container on a production host. The service only needs to read files from a dedicated input directory, but its deployment configuration also mounts `/var/run/docker.sock` into the container. A recent review confirms that the application process can open the socket. The team cannot change the service's functions this quarter, but it can change the container configuration.

Which change most directly removes the host-level control exposed by this deployment?

Show Answer

Correct Answer

A

Option A is correct because the mounted Docker socket lets the application control the host daemon, even if the application process is non-root. Option B is not correct because changing the user does not remove access to the socket. Option C is not correct because a read-only container filesystem does not restrict socket operations. Option D is not correct because no-new-privileges does not restrict Docker API operations.

Question 39 of 46 Single Choice

A Spring Boot 3 application uses Actuator for health checks, and its ingress publishes the management port to the internet. The deployment configuration explicitly enables the shutdown endpoint and includes it in the HTTP exposure list. Operations staff confirm that no deployment or support task uses this endpoint. The team wants to keep health checks available without allowing remote callers to stop the application.

Which configuration change most directly removes the unnecessary shutdown capability?

Show Answer

Correct Answer

A

Option A is correct because disabling and unexposing shutdown removes the operation that an unauthenticated public request can invoke. Option B is not correct because changing the path does not disable the operation. Option C is not correct because the endpoint remains available to callers on the corporate network. Option D is not correct because health detail settings do not affect shutdown.

18

Information Disclosure.

This topic covers ways an application can reveal sensitive information through responses, errors, or exposed data fields. Candidates must identify the disclosure and select a change that limits what an unintended recipient can learn.

Question 40 of 46 Single Choice

A production application has begun returning unhandled exception pages when a reporting request fails. The page includes a stack trace, an internal filesystem path, and names of application classes. Support staff need enough information to investigate individual failures, but ordinary users and customers must not receive internal implementation details. The team can change both the response and server-side error handling.

Which change best prevents the endpoint from disclosing implementation details while preserving useful diagnostic information for the engineering team?

Show Answer

Correct Answer

A

Option A is correct because the response can identify the failure without revealing the filesystem path and framework details, while the reference identifier helps staff find the server-side record. Option B still exposes exception details. Option C exposes the stack trace to clients with a session cookie. Option D removes the diagnostic record needed to investigate the failure.

Question 41 of 46 Single Choice

A retail company provides customers with an API endpoint for viewing product descriptions and availability. A recent change caused the endpoint to serialize the full product database record, including wholesale cost, supplier contract identifiers, and internal procurement comments. Customers are permitted to use the endpoint, and the product team wants to preserve its existing customer-facing fields without exposing internal data.

Which change best prevents the API from disclosing information that customers do not need?

Show Answer

Correct Answer

A

Option A is correct because the server will omit wholesale cost and internal procurement comments from the customer-facing response. Option B is not correct because fields hidden in the browser remain visible in the API response. Option C does not limit disclosure. Option D still sends the same internal values to customers, even if their names are less descriptive.

19

Vulnerable and Outdated Components.

This topic covers identifying application components that are vulnerable or no longer supported. Candidates must assess whether affected components are present and used, then select an appropriate upgrade or migration to a supported release.

Question 42 of 46 Single Choice

A customer support portal uses Apache Commons Text 1.9. A security advisory identifies the deployed release as affected by a vulnerability in its string interpolation functionality. The portal passes user-controlled template text to StringSubstitutor, and testing confirms that the affected lookup behavior is enabled. The release team can update the library and run its regression suite before deployment.

Which action best addresses the confirmed vulnerable component?

Show Answer

Correct Answer

A

Option A is correct because the advisory confirms that the deployed release is affected and that the vulnerable interpolation path processes user-controlled templates. Upgrading to a fixed release addresses the component flaw. Option B applies encoding for a different context. Option C leaves the vulnerable component deployed, and Option D does not change the library's exposure.

Question 43 of 46 Single Choice

A Java web application runs on Apache Tomcat 8.5, which the organization's lifecycle review confirms is no longer supported and receives no security fixes. The application uses Servlet 3.1 features, and its owners can schedule compatibility testing but cannot rewrite the application this quarter. A firewall is already in place, yet the security team requires a durable component-level remediation.

Which remediation plan best reduces the risk from the outdated server component?

Show Answer

Correct Answer

A

Option A is correct because Tomcat 8.5 no longer receives security fixes, so moving to a supported compatible release restores access to vendor updates. Option B relies on filtering and leaves the unsupported component exposed. Option C only hides version information. Option D updates application libraries but does not address the outdated server runtime.

20

Common Supply Chain Attacks and Prevention Methods.

This topic covers attacks that target package sources, software builds, and release processes. Candidates must identify realistic compromise paths and choose controls that establish trusted package origins, verify artifacts, and limit CI/CD exposure.

Question 44 of 46 Single Choice

A team uses npm to build a payment service. Its private registry contains an unscoped package named ledger-utils, and the package is referenced in package.json without a registry restriction. Developers have found a public npm package with the same name, and the build agent can reach both registries. The team needs a durable fix that stops public package publication from taking precedence.

Which change best prevents a public package from being selected in place of the internal package?

Show Answer

Correct Answer

A

Option A is correct because npm can route the organization scope to the company registry, preventing a public package with the old name from satisfying that dependency. Option B is not correct because a lockfile can preserve an untrusted package URL. Option C is not correct because version pinning does not establish package ownership. Option D is not correct because audit reports known vulnerabilities, not every counterfeit package.

Question 45 of 46 Single Choice

A company builds container images with GitHub Actions and stores them in a registry used by production. A recent incident showed that an image tag was replaced after the approved build, while the deployment system checked only that the tag existed. The security team needs to ensure that an image came from the approved workflow and was not substituted before deployment.

Which release control most directly addresses the team's concern?

Show Answer

Correct Answer

B

Option B is correct because verifying the signature and provenance against the expected workflow identity links the deployed image to an authorized build. Option A is not correct because recording a digest after download does not prove who produced the image. Option C is not correct because tags and release notes can be changed. Option D is not correct because vulnerability scanning does not establish artifact origin.

Question 46 of 46 Single Choice

A GitHub Actions workflow uses pull_request_target so it can post test results to a private repository. It checks out code from contributor branches and runs the test suite, while the workflow has access to a publishing token. Fork contributions are allowed, and the team cannot remove automated testing, but it can change workflow triggers and split release steps into a separate workflow.

Which workflow design best limits the risk from untrusted pull request code?

Show Answer

Correct Answer

B

Option B is correct because pull_request runs untrusted fork code without granting it release credentials, and the separate trusted workflow can handle publication. Option A is not correct because checking out contributor code in pull_request_target still runs it in a privileged context. Option C is not correct because the workflow can access secrets after decryption. Option D is not correct because approval does not make the branch code trustworthy.

Continue Your CAP Preparation

You have seen 46 questions from a full set of 60. Prepare with the CAP dumps PDF and the Web-Based Practice Test.

PDF

  • Compatible with All Devices
  • Printable Format
  • No Download Limits

Practice Test

  • Check your timing and weak areas
  • No Practice Limits
  • Regularly Updated
Get Full Access
  • 100% Money-Back Guarantee
  • 90 Days Free Updates
  • Instant Access

Frequently Asked Questions

Which CAP topics make it hardest to choose the right fix for an application flaw?

Many candidates find it difficult to distinguish a symptom from the control that addresses its cause. For example, SQL injection calls for binding values as data, while cross-site scripting requires handling that fits the output context. A general security measure may not solve the specific flaw. Practise explaining how each vulnerability occurs, then name the control that directly prevents it.

Why can business logic and authorization problems be difficult to assess?

These flaws depend on what a user is allowed to do and how an operation is meant to proceed. A client-controlled parameter may expose an IDOR or enable privilege escalation, while a transaction flaw may bypass a required sequence or alter a calculation. The right fix must enforce the intended rule on the server. When studying, trace one operation from request to result and identify each access check.

How can I bridge the gap between learning vulnerability terms and selecting a practical control?

Memorizing names such as SSRF, XXE, and directory traversal is not enough. You need to connect each one to a risky application behavior and a control that fits the case. An Exam4Success PDF can support review away from a lab, while a Practice Test can help reveal which topics need more work. After each question, write down the flaw, its cause, and the control you would apply.

What often goes wrong when candidates use the OWASP Top 10 as their whole study plan?

The OWASP Top 10 is useful for recognizing groups of common application security risks, but it does not prove that every risk in an application has been assessed. Candidates can also spend too much time memorizing category names instead of learning the controls for specific issues such as unsafe file uploads, information disclosure, or vulnerable components. Use the list as an organizing aid, then review every stated CAP topic.

What practical application security skills does the CAP exam focus on?

The listed topics focus on recognizing how common web application weaknesses arise and selecting measures that reduce them. They include input validation, authentication, session handling, TLS, supply chain risks, and business logic, as well as familiar injection flaws. This breadth can help candidates structure their application security knowledge around real development and deployment decisions. Choose one application feature and assess it against several of these topics.

How might preparing for CAP support someone working with application security?

Preparation can give you a clearer framework for discussing secure application behavior with developers and operations teams. The topics connect coding choices, such as parameterized queries, with deployment decisions, such as restricting outbound requests or hardening runtime settings. The exam itself does not establish a particular job outcome. To make the learning relevant to your work, map each topic to one control or review task in an application you know.

How can I judge whether I am ready to attempt the CAP exam?

Readiness is more than recalling a vulnerability definition. You should be able to explain the risk and select a suitable control, such as checking resolved paths for directory boundaries or validating a TLS certificate identity. An Exam4Success Practice Test can help you identify weaker areas and practise working through questions. Review the topics you hesitate on, then retest your reasoning without relying on memorized wording.

What should I study first if I am beginning CAP preparation?

Start with the topics where unsafe input changes application behavior, including SQL injection, cross-site scripting, code injection, and XML external entities. For each, learn what the application does with submitted data and which control prevents that specific outcome. Then move to authorization, sessions, and business logic, where intended user actions matter. Keep an Exam4Success PDF available for structured review and record one unresolved question after each study session.

Exam4Success is an independent exam preparation provider and is not affiliated with or endorsed by The SecOps Group.