1. Home
  2. The SecOps Group
  3. CAP Exam Info
  4. CAP Exam Questions

Curious about Actual The SecOps Group Certified Application Security Practitioner (CAP) Exam Questions?

Here are sample The SecOps Group Certified AppSec Practitioner (CAP) Exam questions from real exam. You can get more The SecOps Group Certified Application Security Practitioner (CAP) Exam premium practice questions at TestInsights.

Page: 1 /
Total 60 questions
Question 1

Which of the following attributes is NOT used to secure the cookie?


Correct : C

Cookies can have security attributes to protect them against various attacks. Let's evaluate each option to determine which attribute is not used to secure cookies:

Option A ('HttpOnly'): The HttpOnly attribute prevents cookies from being accessed by JavaScript (e.g., via document.cookie). This mitigates XSS attacks that attempt to steal session cookies, making it a valid security attribute.

Option B ('Secure'): The Secure attribute ensures that the cookie is only sent over HTTPS connections, preventing it from being transmitted over unencrypted HTTP. This protects against interception (e.g., in a man-in-the-middle attack), making it a valid security attribute.

Option C ('Restrict'): There is no standard cookie attribute called Restrict. Cookie security attributes are well-defined (e.g., HttpOnly, Secure, SameSite), and Restrict does not exist in this context. This is not a valid attribute for securing cookies.

Option D ('Same-Site'): The SameSite attribute (e.g., SameSite=Strict or SameSite=Lax) controls whether a cookie is sent with cross-site requests. It helps mitigate CSRF attacks by ensuring the cookie is only sent with same-site requests (or limited cross-site scenarios), making it a valid security attribute.

The correct answer is C, as Restrict is not a recognized cookie attribute, aligning with the CAP syllabus under 'Cookie Security' and 'Session Management.'


Options Selected by Other Users:
Mark Question:

Start a Discussions

Submit Your Answer:
0 / 1500
Question 2

Determine the primary defense against a SQL injection vulnerability


Correct : B

SQL Injection (SQLi) occurs when an attacker injects malicious SQL code into a query by manipulating user input (e.g., ' OR '1'='1'), allowing unauthorized data access or manipulation. Let's evaluate the defenses:

Option A ('Using a Web Application Firewall (WAF)'): A WAF can detect and block SQL injection attempts by filtering malicious patterns (e.g., ' OR '1'='1'), but it is not the primary defense. WAFs can be bypassed with sophisticated attacks (e.g., encoded payloads), and they are a secondary layer, not a fix for the root cause in the application code.

Option B ('Prepared Statements with Parameterized Queries'): Correct. Prepared statements with parameterized queries separate SQL code from user input by using placeholders (e.g., ? in SELECT * FROM users WHERE username = ?). The database engine handles the input as data, not executable code, preventing SQL injection. This is the industry-standard primary defense (recommended by OWASP and NIST) because it addresses the root cause by ensuring user input cannot alter the query structure.

Option C ('Use of NoSQL Database'): Switching to a NoSQL database (e.g., MongoDB) does not inherently prevent injection vulnerabilities. NoSQL databases can still be vulnerable to injection (e.g., MongoDB's $where operator), and SQL injection applies to relational databases. This is not a defense against SQLi.

Option D ('Blacklisting Single Quote Character (')'): Blacklisting specific characters (e.g., ') attempts to block known malicious input, but it is ineffective as a primary defense. Attackers can bypass blacklists using alternate encodings (e.g., %27 for '), comments (e.g., --), or other techniques. Blacklisting is reactive and prone to evasion, unlike prepared statements.

The correct answer is B, aligning with the CAP syllabus under 'SQL Injection Prevention' and 'OWASP Top 10 (A03:2021 - Injection).'


Options Selected by Other Users:
Mark Question:

Start a Discussions

Submit Your Answer:
0 / 1500
Question 3

Which of the following HTTP response header prevents the client from caching the HTTP response in the most secure manner?


Correct : A

Caching HTTP responses can pose security risks, especially for sensitive data, as cached responses might be accessed by unauthorized users (e.g., on a shared device). The goal is to identify the HTTP response header that prevents caching in the most secure way. Let's evaluate the options:

Option A ('Cache-Control: no-cache, no-store'): Correct. The Cache-Control header with no-cache instructs clients to revalidate with the server before using a cached copy, and no-store prohibits caching entirely (no storage in any cache, including browser, proxy, or CDN). This combination ensures the response is not cached, providing the most secure prevention of caching for sensitive data.

Option B ('Secure-Cache: Enabled'): There is no standard HTTP header called Secure-Cache. This appears to be a made-up option and is not a valid mechanism for controlling caching.

Option C ('Cache-Control: Private'): The Cache-Control: Private directive allows caching but restricts it to the user's private cache (e.g., browser cache), preventing shared caches (e.g., proxies) from storing the response. However, it still permits caching in the browser, which is less secure than preventing all caching, especially for sensitive data.

Option D ('Content-Security-Policy: no-cache, no-store'): The Content-Security-Policy (CSP) header is used to mitigate XSS and other attacks by controlling which resources can be loaded (e.g., scripts, images). It does not control caching, and no-cache, no-store are not valid CSP directives. This is incorrect.

The correct answer is A, as Cache-Control: no-cache, no-store is the most secure way to prevent caching, aligning with the CAP syllabus under 'HTTP Headers Security' and 'Sensitive Data Protection.'


Options Selected by Other Users:
Mark Question:

Start a Discussions

Submit Your Answer:
0 / 1500
Question 4

Your application is hosting JavaScript from a third-party website as shown in the snippet below.

Which of the following is true regarding the code snippet?


Correct : C

The code snippet loads a JavaScript file from a third-party CDN with integrity and crossorigin attributes. Let's analyze what these attributes do:

The integrity attribute specifies a Subresource Integrity (SRI) hash (e.g., sha384-Fmb0CYeA6gM2uLuyvqs7x75u0mktDh2nKLomp3PHkJ0b5vJF2qF6Gbrc/6dK), which the browser uses to verify the integrity of the loaded script. If the script's content does not match the hash, the browser will not execute it, protecting against tampering (e.g., if the CDN is compromised).

The crossorigin='anonymous' attribute ensures the request does not send credentials (e.g., cookies) and allows the script to be loaded from a different origin while enabling CORS (Cross-Origin Resource Sharing).

Option A ('The code snippet will perform validations for Cross-Site Scripting attacks'): Incorrect. XSS (Cross-Site Scripting) involves injecting malicious scripts into a page. The integrity attribute ensures the script's integrity but does not validate the script's content for XSS vulnerabilities (e.g., if the script itself contains malicious code). XSS prevention requires other measures, like Content Security Policy (CSP) or input sanitization.

Option B ('The code snippet will perform validations for Cross-Site Request Forgery attacks'): Incorrect. CSRF (Cross-Site Request Forgery) involves tricking a user into making unintended requests. The integrity and crossorigin attributes do not address CSRF, which requires server-side protections like CSRF tokens.

Option C ('The code snippet will perform Subresource Integrity (SRI) checks'): Correct. The integrity attribute explicitly enables SRI, ensuring the browser verifies the script's hash before execution. This protects against supply chain attacks where a third-party script might be modified maliciously.

Option D ('The code snippet will perform validations for Outdated Javascript checks'): Incorrect. The snippet does not check for outdated JavaScript versions. SRI ensures the script matches the expected hash but does not validate the script's version or security status.

The correct answer is C, aligning with the CAP syllabus under 'Subresource Integrity (SRI)' and 'Third-Party Script Security.'


Options Selected by Other Users:
Mark Question:

Start a Discussions

Submit Your Answer:
0 / 1500
Question 5

In the screenshot below, an attacker is attempting to exploit which vulnerability?

POST /dashboard HTTP/1.1

Host: example.com

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) rv:107.0) Gecko/20100101 Firefox/107.0

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8

Accept-Language: en-GB,en;q=0.5

Accept-Encoding: gzip, deflate

Upgrade-Insecure-Requests: 1

Sec-Fetch-Dest: document

Sec-Fetch-Mode: navigate

Sec-Fetch-Site: none

Sec-Fetch-User: ?1

Cookie: JSESSIONID=7576572ce164646de967c759643d53031

Te: trailers

Connection: keep-alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 81

xml_foo=]>&example;

]>&example;

&example;

Project Meeting

changed example


Correct : D

The request is a POST to /dashboard with a payload containing XML data, specifically an xml_foo parameter with a <!DOCTYPE> declaration and an XML entity (<!ENTITY example SYSTEM 'file:///etc/passwd'>). Let's analyze the vulnerability:

The payload defines an XML External Entity (XXE) with <!ENTITY example SYSTEM 'file:///etc/passwd'>, which instructs the XML parser to fetch the contents of /etc/passwd (a sensitive system file) and include it in the &example; reference. The XML then includes <foo>&example;</foo>, which would expand to the contents of /etc/passwd if the parser processes the entity.

This is a classic XML External Entity (XXE) Attack, where an attacker exploits an XML parser's ability to process external entities to access unauthorized resources (e.g., local files, internal network services) or cause denial-of-service. If the application's XML parser is misconfigured to allow external entity resolution, this attack can disclose sensitive data like /etc/passwd.

Option A ('Path Traversal Attack'): Incorrect. Path Traversal involves manipulating file paths (e.g., ../../etc/passwd) to access unauthorized files. While the attack aims to access /etc/passwd, it does so via XML entity resolution, not path traversal.

Option B ('Server Side Template Injection'): Incorrect. SSTI (Server-Side Template Injection) involves injecting template expressions (e.g., {{7*7}}) into a server-side template engine. The payload here is XML, not a template expression, and targets XML parsing, not a template engine.

Option C ('XML Bomb Attack'): Incorrect. An XML Bomb (or Billion Laughs attack) involves recursive entity expansion to cause denial-of-service (e.g., <!ENTITY a '&b;&b;'> <!ENTITY b 'lol'>), leading to exponential growth in memory usage. This payload defines a single external entity to fetch a file, not a recursive expansion, so it's not an XML Bomb.

Option D ('XML External Entity Attack'): Correct, as the payload exploits XXE by defining an external entity to access /etc/passwd.

The correct answer is D, aligning with the CAP syllabus under 'XML External Entity (XXE) Attacks' and 'OWASP Top 10 (A04:2021 - Insecure Design).'


Options Selected by Other Users:
Mark Question:

Start a Discussions

Submit Your Answer:
0 / 1500
Page:    1 / 12   
Total 60 questions