Exam Information
Free practice questions with explanations
The SecOps Group CAP Practice Questions
Answer a question to see the correct answer and the explanation, or click Show answer. Newest questions first.
- Questions
- 16
- Answered
- 0
- Correct
- 0
- Score
- -
-
1 Question 1 Single choice Authorization and Session Management related flaws
A logistics company exposes an endpoint GET /api/v2/shipments/{shipmentId}/documents that returns invoices for the authenticated carrier. Shipment IDs are sequential integers. A tester logged in as carrier 1007 requests shipmentId=50231, which belongs to carrier 2290, and receives the invoice. The company has a strict constraint: the mobile app cannot be changed this quarter, and the API gateway is managed by a separate team that only allows configuration of rate limits and TLS policy. Which remediation is the BEST fix for the root cause?
Correct Answer: DExplanationThe flaw is an Insecure Direct Object Reference: the server trusts the shipmentId parameter without verifying ownership. Only an authorization check in the endpoint code, comparing the record's carrier to the authenticated carrier, removes the root cause. Random UUIDs only hide the identifier and still permit access to anyone who learns one. Rate limiting slows enumeration but does not stop a single valid request, and cookie flags address session theft rather than authorization logic. The gateway constraint rules out fixes that require app changes, but the check is server-side and is therefore the correct location.
-
2 Question 2 Single choice Input Validation Mechanisms
A payments team accepts a country_code field and must prevent injection of unexpected values into a downstream reporting service. The field should only ever be one of 240 ISO 3166-1 alpha-2 codes, which are maintained in a reference table. Developers propose a blocklist that rejects strings containing quotes, semicolons, and angle brackets. A security engineer argues this is insufficient because the downstream service processes the value after a decode step. Which validation approach is the BEST choice?
Correct Answer: BExplanationA whitelist that accepts only members of a known finite set is the strongest input validation mechanism when the valid domain is small and enumerable. Validating after canonicalization ensures encoded variants cannot slip past the check. Blocklists, even extended ones, depend on anticipating every dangerous character and encoding, which the team cannot guarantee. Escaping at storage time does not account for the later decode step, and a loose length-based rule still accepts arbitrary content.
-
3 Question 3 Single choice XML External Entity attack
A healthcare SaaS vendor runs a Java-based service that parses inbound HL7 XML messages from partner clinics. A recent penetration test showed that a crafted message caused the parser to read /etc/hosts on the server. The service must keep accepting DOCTYPE declarations because one partner's legacy system includes them for internal reference, and the vendor cannot upgrade the partner. The fix must be applied in the parser configuration and must not disable XML processing altogether. Which configuration change is the BEST fix?
Correct Answer: AExplanationThe attack depends on external general and parameter entities being resolved, so disabling those two features in the parser stops file disclosure while leaving internal DOCTYPE handling intact, which satisfies the partner constraint. Disallowing DOCTYPE entirely would break the legacy partner and is ruled out by the stated constraint. Schema validation occurs after the parser has already resolved entities, so the disclosure still happens. Recursive expansion with a depth limit addresses billion-laughs denial of service, not external entity file reads.
-
4 Question 4 Single choice Directory Traversal Vulnerabilities
A document-management web application serves uploaded files through the URL /download?file=, which the backend joins with a base directory of /srv/docs/. Security review found that requesting file=../../etc/passwd returns system content. The team has decided to validate input before joining the path. The application runs on Linux and must support nested folders under /srv/docs/ because customers organise files into subdirectories. Which control is the MOST robust fix?
Correct Answer: AExplanationResolving the path to its canonical form and confirming it remains under the base directory defeats traversal sequences, encoded variants, and symbolic link tricks, while still allowing nested subfolders as required. Stripping ../ once is bypassed by payloads such as ....// that collapse after removal. Rejecting slashes breaks the requirement for nested folders. File permissions limit what the process can read, but /etc/passwd is world-readable, so the traversal still succeeds.
-
5 Question 5 Single choice TLS security
A fintech company runs a public API behind a load balancer that terminates TLS. A scanner reports the certificate chain is incomplete: the server presents only the leaf certificate, and some Android 6 clients fail to connect while desktop browsers succeed because they fetch the intermediate automatically. The security team must not weaken protocol versions or disable certificate validation on clients. Which action resolves the issue with the LEAST change?
Correct Answer: CExplanationClients that do not perform authority information access fetching need the full chain delivered by the server, so bundling the intermediate certificate with the leaf fixes the misconfiguration without touching protocols or client trust. Enabling TLS 1.0 is a security regression and is explicitly prohibited. Switching key algorithms does not add a missing intermediate and would still leave the chain incomplete. Asking every Android user to install the root is impractical and does not address the server-side misconfiguration.
-
6 Question 6 Multiple choice Security Best Practices and Hardening Mechanisms.
A retail company is hardening its customer portal, which serves HTML pages from its own origin and loads scripts from a single approved CDN host. Penetration testers reported that the portal can be framed by a third-party site, and that injected scripts could exfiltrate session data to arbitrary domains. The team must block framing and restrict script sources without breaking the CDN dependency. Which TWO response headers together meet these requirements? (Choose two.)
Correct Answer: B, EExplanationContent-Security-Policy with a script-src allowlist limits where scripts may load from, which restricts exfiltration through injected code, and its frame-ancestors directive blocks framing. X-Frame-Options DENY provides legacy anti-framing coverage for browsers that ignore frame-ancestors. Strict-Transport-Security concerns transport encryption, not framing or script sources. X-Content-Type-Options prevents MIME sniffing and does not restrict either behaviour. Referrer-Policy limits referrer leakage, which does not address the stated framing or script risks.
-
7 Question 7 Single choice SQL Injection
A reporting API builds a query by concatenating the sortBy parameter into an ORDER BY clause, because SQL placeholders cannot be used for column identifiers. The team's proposed fix is to use a prepared statement for the WHERE clause only and rely on a blocklist for the sort field. The application has 14 sortable columns and no user-specific column access rules. Which fix addresses the vulnerability MOST reliably?
Correct Answer: CExplanationColumn identifiers cannot be bound as parameters, so the reliable control is an allowlist that maps each permitted input to a fixed, developer-defined identifier, eliminating attacker-controlled SQL text in the ORDER BY position. Escaping quotes does not help because identifiers are not quoted strings and payloads can use other syntax. A stored procedure that still concatenates the sort field keeps the injection. A keyword blocklist is easily bypassed through case changes, comments, and alternate syntax.
-
8 Question 8 Order list Brute force Attacks; Password Storage and Password Policy
A consumer app is migrating its user password store from unsalted MD5 hashes to a modern scheme, and must also prevent online guessing against login. The steps below are shuffled. Place them in the correct order to perform the migration safely. Drag the steps into the correct order.
Drag the steps into the correct order, or use the arrows.
- Schedule a deadline after which legacy-hash accounts can no longer authenticate
- Deploy the new hashing code so that all new and changed passwords use the new scheme
- Enable per-account throttling and lockout tuned to the login path
- Force a password reset on next login for accounts whose hash has not been upgraded
- Store the new hash using a memory-hard or adaptive algorithm with a per-user salt
- On successful login with a legacy hash, verify the password against the old hash
Correct Answer:- Deploy the new hashing code so that all new and changed passwords use the new scheme
- Enable per-account throttling and lockout tuned to the login path
- On successful login with a legacy hash, verify the password against the old hash
- Store the new hash using a memory-hard or adaptive algorithm with a per-user salt
- Schedule a deadline after which legacy-hash accounts can no longer authenticate
- Force a password reset on next login for accounts whose hash has not been upgraded
ExplanationThe new hashing code must ship first so every new or changed password is stored safely, and throttling should be enabled before migration so the legacy login path is protected during the transition. Next the app verifies legacy hashes on login and rehashes them with the new scheme, which requires step 2 to be in place after step 3's verification flow. The deadline comes after the migration window is set, and forced resets are the final fallback for accounts that never logged in. Enabling lockout before deploying hashing code would leave the legacy window unprotected for no benefit.
-
9 Question 9 Single choice Information Disclosure.
A security architect reviews four disclosure findings from a web application scan and must match each to the most appropriate remediation.
1. Stack traces with database driver names returned in HTTP 500 responses
2. Backup file config.bak publicly downloadable from the web root
3. Server header revealing exact web server version and build date
4. Source map files exposing unminified client-side code in production
Targets: Set custom error pages and log details server-side; Remove backup artifacts from the deployed artifact and restrict web root; Suppress or genericize the version banner in server configuration; Disable source map generation for production builds.Correct Answer: DExplanationStack traces leak internals and are fixed by generic error handling with details logged internally, while the backup file is a deployment artifact problem that requires removing it from the build and restricting the web root. The version banner is handled by suppressing it in the server configuration, and source maps are controlled at build time by not generating them for production. The other mappings put remediations on the wrong findings, such as treating a deployed backup file as a header issue or a stack trace as a build setting.
-
10 Question 10 Dropdown Cross-Site Request Forgery
The team must allow the cookie to be sent on cross-site subresource requests from the widget, which requires SameSite=None, and it must be transmitted only over HTTPS. Choose the correct value for each blank.
Choose the correct value for each blank.
A banking app needs to protect its fund-transfer endpoint against cross-site request forgery while keeping cookies compatible with a partner payment widget embedded in third-party sites. The session cookie is set as follows: Set-Cookie: session=abc123; Path=/; ;Correct Answer:A banking app needs to protect its fund-transfer endpoint against cross-site request forgery while keeping cookies compatible with a partner payment widget embedded in third-party sites. The session cookie is set as follows: Set-Cookie: session=abc123; Path=/; SameSite=None; Secure
ExplanationBrowsers only accept SameSite=None when the cookie also carries the Secure attribute, so the pairing SameSite=None with Secure both enables cross-site delivery to the widget and ensures transmission only over HTTPS. SameSite=Lax and Strict block the cross-site subresource requests the widget depends on. Adding HttpOnly is good practice but does not satisfy the HTTPS requirement, and Max-Age alone provides no transport protection and is not paired with Secure, which modern browsers would reject for SameSite=None.
-
11 Question 11 Single choice Server-Side Request Forgery
A cloud-hosted image-processing service accepts a URL from users and fetches the image server-side. Security review found that submitting http://169.254.169.254/latest/meta-data/ returned instance metadata. The service must continue to fetch images from arbitrary public internet hosts, and the platform team cannot move the workload into a network without egress. Which control is the MOST effective?
Correct Answer: CExplanationValidating the resolved IP address against private and link-local ranges, then connecting to that exact address, prevents both direct IP access to 169.254.169.254 and DNS rebinding that changes the answer between check and use. Requiring HTTPS does not stop an internal HTTPS service or the metadata endpoint, which may be queried by IP. Hostname blocklists are bypassed by raw IP literals and alternate encodings. Disabling redirects helps but leaves direct private-address requests unrestricted.
-
12 Question 12 Single choice Vulnerable and Outdated Components.
A company's build pipeline runs a dependency scanner that flags a logging library version 2.14.1 used in a service that is internet-facing and processes user-supplied strings into log messages. The vendor has published a fixed version 2.17.1 that is a minor upgrade within the same major line. The service team reports that upgrading requires rebuilding a container image that is scheduled for release in six weeks. The security team wants the risk reduced now. Which action is the BEST immediate response, while still planning the upgrade?
Correct Answer: BExplanationA compensating control reduces exposure immediately for an internet-facing component that handles untrusted input, and a tracked change ensures the fixed version lands in the next release. Accepting the risk without mitigation is inappropriate for an exposed, known-vulnerable component. Rewriting all logging calls is a large unplanned change that exceeds the six-week timeline. Pinning to the prior version locks in the vulnerable release and makes the risk worse.
-
13 Question 13 Multiple choice Business Logic Flaws
An online ticketing platform offers a promotion of one free ticket per customer account. Testers found that a user could apply the promotion code, cancel the order, and reapply the code to receive unlimited free tickets. The development team must fix this without breaking legitimate refunds for paid orders. Which TWO controls address the flaw at the correct layer? (Choose two.)
Correct Answer: C, DExplanationTreating the free-ticket allowance as a server-side entitlement that is consumed once and not returned on cancellation enforces the business rule regardless of client behaviour, and a uniqueness constraint in the database makes the rule hold under concurrent requests. Hiding the field is client-side and bypassed by replaying requests. CAPTCHA does not enforce a business rule. Weekly alerts detect abuse after the fact rather than preventing it.
-
14 Question 14 Single choice Security Misconfigurations.
A team deploys an internal Node.js API into a cloud Kubernetes cluster. A review finds the pod manifests run the container as root, mount the host filesystem path /var/run/docker.sock, and set allowPrivilegeEscalation to true. The API is only reachable from within the cluster. The security team wants the change with the greatest reduction in blast radius and no functional impact on the API, which reads and writes only to its own application directory. Which configuration change is the MOST effective?
Correct Answer: AExplanationThe host socket mount and root execution together let a compromised container control the node runtime, so removing the mount, running as non-root, and disabling privilege escalation sharply limit escape paths without affecting an API that only uses its own directory. A NetworkPolicy and TLS are valuable but do not address the container-escape exposure the misconfigurations create. Resource limits protect against exhaustion, not privilege abuse.
-
15 Question 15 Single choice Encoding, Encryption and Hashing
A payments service stores card tokens and must protect them at rest. The engineering team proposes encrypting values with AES-256 in ECB mode using a key stored in an environment variable, and computing a lookup index as an unsalted SHA-256 of the card number. The security team has a constraint that the index must support equality lookup without exposing the card number, and that the design must not use any reversible transformation on the index. Which change MOST improves the design?
Correct Answer: BExplanationECB leaks equal plaintext blocks and provides no integrity, so an authenticated mode with unique nonces is required, and keeping the key in a managed KMS removes it from the environment. AES-512 does not exist, and doubling key length would not fix ECB's structural weakness. MD5 is broken and offers no benefit over SHA-256. Base64 is an encoding that is trivially reversed and adds no security to the hash input.
-
16 Question 16 Single choice Code Injection Vulnerabilities
A web application lets administrators define report filters as expressions, which the server evaluates with a scripting engine so that a filter like amount > 500 works. A tester submitted an expression that invoked the runtime's process-execution API and returned command output. The team must keep the feature for administrators who write expressions. Which control is the MOST appropriate fix?
Correct Answer: AExplanationA purpose-built parser for a restricted grammar removes the ability to call arbitrary runtime functions, which is the root cause, while still supporting the legitimate comparisons administrators need. Restricting access to administrators does not stop the code execution risk from a compromised or careless admin. A sandboxed container limits impact but leaves the code execution in place. Blocklists of API names are easy to bypass through indirect references and alternative APIs.
These are 16 of the 60 questions in the full CAP pack.
Get All 60 QuestionsGet all 60 questions & answers
Full access options for The SecOps Group CAP
Self-study
PDF Version
- 60 actual exam questions
- Compatible with all devices
- Printable PDF format
- No download limits
- 90 days free updates
- 24/7 customer support
Best value
Bundle Pack
- Discounted PDF + online access
- 60 actual exam questions
- Both PDF and online practice test
- Free 90 days updates
- No download or practice limits
- 24/7 customer support
Exam simulation
Online Practice Test
- 60 actual exam questions
- Actual exam environment
- 90 days free updates
- Browser-based software
- 24/7 customer support
100% Money Back Guarantee
Your success comes first
At DumpsProvider, we give you a 100% money back guarantee on all of our exam dumps. For us, your success is the #1 priority and we are more than confident that our exam material will help you pass the CAP Exam (Certified AppSec Practitioner Exam) on your very first attempt.
In a rare case, if you fail your exam, we will refund your amount without asking a single question.