Courseiva

CCNA Software Development Security Questions

40 questions · Software Development Security · All types, answers revealed

1
MCQmedium

Which type of testing analyzes source code for security vulnerabilities without executing the program?

A.Static Application Security Testing (SAST)
B.Interactive Application Security Testing (IAST)
C.Penetration testing
D.Dynamic Application Security Testing (DAST)
AnswerA

Static Application Security Testing (SAST) tools analyze an application's source code, bytecode, or binary code without actually executing the program. This "white-box" testing approach identifies security vulnerabilities such as SQL injection, cross-site scripting (XSS), and buffer overflows by examining code patterns, data flow, and control flow paths that could lead to exploits. It is typically performed early in the Software Development Life Cycle (SDLC), providing developers with immediate feedback on potential flaws before deployment.

Why this answer

Static Application Security Testing (SAST) analyzes source code, bytecode, or binary code for security vulnerabilities without executing the program. It operates by scanning the codebase for known patterns, such as SQL injection or buffer overflow, using techniques like data flow analysis and taint tracking. This white-box approach identifies issues early in the Software Development Life Cycle (SDLC), making it the correct answer for testing that does not require runtime execution.

Exam trap

The trap here is that candidates confuse SAST with DAST because both are automated security testing tools, but SAST is static (no execution) and DAST is dynamic (requires execution), and the question explicitly states 'without executing the program' to eliminate DAST.

How to eliminate wrong answers

Option B (Interactive Application Security Testing, IAST) is wrong because IAST requires the application to be running and instruments the code during execution to detect vulnerabilities, often combining elements of SAST and DAST. Option C (Penetration testing) is wrong because it is a manual or automated black-box/gray-box test that actively exploits vulnerabilities in a running system, not analyzing source code statically. Option D (Dynamic Application Security Testing, DAST) is wrong because it tests the application from the outside while it is executing, typically by sending HTTP requests and analyzing responses, without access to the source code.

2
MCQhard

A security engineer is evaluating a new third-party software component for use in a critical application. Which document is most important to review to understand the component's supply chain security?

A.End User License Agreement (EULA)
B.Service Level Agreement (SLA)
C.Data Processing Agreement (DPA)
D.Software Bill of Materials (SBOM)
AnswerD

A Software Bill of Materials (SBOM) is a formal, machine-readable inventory of all the software components and dependencies used in a particular application, including open-source and commercial libraries. It provides a comprehensive list of ingredients, their versions, and often their licenses, offering crucial transparency into the software's supply chain. For a security engineer, an SBOM is invaluable for identifying potential vulnerabilities, tracking known exploits (like Log4Shell), and managing risks associated with third-party components, making it the ideal tool for evaluating new software.

Why this answer

A Software Bill of Materials (SBOM) lists all components, libraries, and dependencies used in the software. It is essential for assessing supply chain risk and identifying known vulnerabilities.

3
MCQhard

A development team is using a third-party library that is known to have a critical vulnerability. The team decides to continue using the library because it is widely used and the vulnerability has not been exploited. Which security risk is the team ignoring?

A.Insecure deserialization
B.Insufficient logging and monitoring
C.Using components with known vulnerabilities
D.Security misconfiguration
AnswerC

This option precisely describes the scenario where a development team incorporates a third-party library that contains publicly disclosed security flaws. Such components, often found in open-source libraries or commercial software, introduce significant risk because attackers can exploit these known weaknesses. Proactively identifying and remediating these vulnerabilities, typically through patching or replacement, is critical for maintaining application security posture.

Why this answer

The team is ignoring the risk of using components with known vulnerabilities, which is explicitly listed in the OWASP Top 10 (A06:2021). Even if a vulnerability has not been exploited yet, continuing to use a library with a known CVE (e.g., a remote code execution flaw in an older version of Log4j) exposes the application to potential attacks once exploit code becomes public. The decision based on 'wide usage' and 'no exploitation so far' is a fallacy, as threat actors often target widely deployed libraries precisely because of their large attack surface.

Exam trap

The trap here is that candidates may think 'no exploitation yet' means the risk is acceptable, but CISSP tests the principle that known vulnerabilities must be remediated regardless of current exploit status, as threat actors will eventually weaponize them.

How to eliminate wrong answers

Option A is wrong because insecure deserialization refers to the lack of validation on serialized objects (e.g., Java deserialization of untrusted data leading to RCE), which is a different vulnerability class not directly related to using a library with a known flaw. Option B is wrong because insufficient logging and monitoring is a failure to detect and respond to security events (e.g., not logging failed authentication attempts), not the decision to use a vulnerable component. Option D is wrong because security misconfiguration involves improper setup of security controls (e.g., default credentials, open cloud storage buckets), not the conscious choice to retain a library with a published CVE.

4
MCQmedium

A security analyst is reviewing the error handling of an application. The application currently displays detailed stack traces to users when an exception occurs. Which of the following is the best practice for error handling in production?

A.Display generic error messages to users and log detailed errors for admins
B.Display detailed errors to users for troubleshooting
C.Disable all error reporting to eliminate information leakage
D.Encrypt error messages before displaying to users
AnswerA

Displaying generic error messages like 'An unexpected error occurred' to users is a critical security practice that prevents the inadvertent disclosure of sensitive system information, such as database schemas, server configurations, or internal file paths. Concurrently, logging detailed error messages, including stack traces and specific error codes, for administrators is essential for effective debugging, incident response, and proactive identification of application vulnerabilities. This balanced approach ensures operational efficiency and maintainability without compromising the application's security posture by exposing internal workings to potential attackers.

Why this answer

Detailed error messages can leak sensitive information. Production systems should show generic messages to users and log detailed errors for administrators.

5
MCQeasy

During the requirements gathering phase of a software development project, which threat modeling methodology is most commonly used to identify threats such as spoofing, tampering, and elevation of privilege?

A.CVSS
B.STRIDE
C.OCTAVE
D.PASTA
AnswerB

STRIDE is a widely recognized threat modeling methodology developed by Microsoft, specifically designed to identify and categorize potential threats to a system during its design phase. Its acronym represents six distinct threat categories: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege. These categories directly map to fundamental security properties like Authenticity, Integrity, Non-Repudiation, Confidentiality, Availability, and Authorization, making it highly effective for systematic threat identification in software.

Why this answer

STRIDE is a threat modeling methodology developed by Microsoft that categorizes threats into six types: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege. During the requirements gathering phase, STRIDE is commonly used to systematically identify and classify potential security threats against each system component, making it the correct choice for identifying threats like spoofing, tampering, and elevation of privilege.

Exam trap

The trap here is that candidates often confuse CVSS (a scoring system) or OCTAVE (a risk assessment framework) with threat modeling methodologies, but the question specifically asks for the methodology most commonly used to identify threat types like spoofing and tampering, which is STRIDE.

How to eliminate wrong answers

Option A (CVSS) is wrong because CVSS (Common Vulnerability Scoring System) is a framework for scoring the severity of known vulnerabilities, not a threat modeling methodology used during requirements gathering to identify threats like spoofing or tampering. Option C (OCTAVE) is wrong because OCTAVE (Operationally Critical Threat, Asset, and Vulnerability Evaluation) is a risk assessment framework focused on organizational risk and strategic planning, not a lightweight threat modeling technique for identifying specific threat types during software development requirements. Option D (PASTA) is wrong because PASTA (Process for Attack Simulation and Threat Analysis) is a risk-centric threat modeling methodology that aligns business objectives with technical requirements, but it is not the most commonly used methodology for simply identifying threats like spoofing, tampering, and elevation of privilege during the requirements phase; STRIDE is more straightforward and widely adopted for that purpose.

6
Multi-Selectmedium

A security engineer is evaluating a web application for common vulnerabilities. The application uses a Content Management System (CMS) that is outdated and has known vulnerabilities. Additionally, the application displays detailed error messages and uses default administrative credentials. Which TWO of the following OWASP Top 10 categories are most relevant to these issues?

Select 2 answers
A.Vulnerable and Outdated Components
B.Security Misconfiguration
C.Injection
D.Cryptographic Failures
E.Broken Access Control
AnswersA, B

Vulnerable and Outdated Components refers to the risk posed by using software components, such as libraries, frameworks, and other modules, that have known security flaws or are no longer supported. Exploiting these vulnerabilities, often documented as Common Vulnerabilities and Exposures (CVEs), can grant attackers unauthorized access, data breaches, or system control. Regularly updating and patching all third-party components is crucial to mitigate this significant attack vector.

Why this answer

A is correct because the outdated CMS with known vulnerabilities directly corresponds to OWASP A06:2021 – Vulnerable and Outdated Components. This category covers using software versions with unpatched security flaws, which attackers can exploit via public exploit databases or automated scanners. B is correct because displaying detailed error messages and using default administrative credentials are classic examples of Security Misconfiguration (OWASP A05:2021).

This occurs when security settings are not properly defined, implemented, or maintained, allowing attackers to gain information or unauthorized access.

Exam trap

Candidates may incorrectly associate default credentials with Broken Access Control, but these are a security misconfiguration. The outdated CMS is clearly Vulnerable and Outdated Components.

7
MCQhard

A security architect is designing an authentication system. To prevent session fixation attacks, which secure design principle should be implemented?

A.Using HTTPS for all communications
B.Setting session timeout to 30 minutes
C.Implementing multi-factor authentication
D.Regenerating session IDs after successful login
AnswerD

Regenerating the session ID immediately after a user successfully authenticates is the most effective direct countermeasure against session fixation. This action ensures that any session ID an attacker might have previously forced upon the victim's browser becomes invalid and unusable. By issuing a completely new, cryptographically random session ID for the authenticated session, the application effectively severs the link between the attacker's known ID and the legitimate user's secure session, preventing unauthorized access.

Why this answer

Session fixation attacks occur when an attacker forces a user to use a known session ID. Regenerating the session ID after successful login (e.g., via `session_regenerate_id()` in PHP or `HttpServletRequest.changeSessionId()` in Java) ensures that the pre-authentication session ID is discarded and a new, unpredictable one is issued, breaking the attacker's control.

Exam trap

The trap here is that candidates confuse session fixation with session hijacking or general secure transmission, leading them to choose HTTPS or MFA, which are important but do not directly counter the fixation mechanism.

How to eliminate wrong answers

Option A is wrong because HTTPS encrypts data in transit but does not prevent an attacker from fixing a session ID before login; it protects against eavesdropping, not session fixation. Option B is wrong because setting a session timeout limits the window of opportunity for an attacker to use a fixed session, but it does not invalidate the fixed session ID after authentication; the attacker can still reuse it within the timeout period. Option C is wrong because multi-factor authentication strengthens identity verification but does not address the core issue of an attacker controlling the session ID; the fixed session ID remains valid even with MFA.

8
MCQhard

A developer is implementing cryptographic storage for sensitive user data. Which of the following is a cryptographic best practice?

A.Using a static initialization vector (IV) for all encryption operations
B.Encrypting data with a hardcoded key in source code
C.Hashing passwords with MD5 for performance
D.Using AES-256 in Galois/Counter Mode (GCM) for authenticated encryption
AnswerD

Using AES-256 in Galois/Counter Mode (GCM) for authenticated encryption represents a strong and recommended cryptographic best practice. AES-256 provides robust confidentiality with its 256-bit key, making brute-force attacks computationally infeasible. GCM, as an Authenticated Encryption with Associated Data (AEAD) mode, simultaneously ensures data integrity and authenticity by generating an authentication tag, which verifies that the ciphertext has not been tampered with and originated from a legitimate source. This combination offers comprehensive protection against both eavesdropping and active manipulation.

Why this answer

Industry-standard algorithms like AES-256 and SHA-256 are recommended, while MD5 and SHA-1 are deprecated due to weaknesses. Authenticated encryption (e.g., GCM) provides both confidentiality and integrity.

9
MCQmedium

During a security review of a web application, testers discover that the application discloses detailed error messages to users, including stack traces. Which secure coding best practice is being violated?

A.Input validation
B.Error handling
C.Secure logging
D.Output encoding
AnswerB

Proper error handling is the direct solution to preventing sensitive information disclosure through error messages. It mandates that applications gracefully intercept all exceptions and internal failures, subsequently presenting only generic, non-informative messages to end-users. Crucially, detailed diagnostic information, such as stack traces or database errors, must be securely logged on the server-side for administrators to troubleshoot, ensuring that no sensitive system details are inadvertently exposed to potential attackers or unauthorized individuals.

Why this answer

Error handling best practices dictate that generic error messages should be shown to users, while detailed errors (e.g., stack traces) should be logged internally to avoid information disclosure.

10
MCQmedium

During a security assessment, a penetration tester discovers that a web application exposes internal IP addresses in error messages. Which vulnerability category does this represent?

A.Broken access control
B.Sensitive data exposure
C.Security misconfiguration
D.Insecure deserialization
AnswerC

Security misconfiguration is the correct classification because verbose error messages, which reveal internal IP addresses and potentially other system details like software versions or stack traces, are a direct result of improper system hardening. Production environments should be configured to suppress such detailed output, presenting only generic error messages to end-users. This prevents attackers from gathering valuable reconnaissance information that could facilitate further targeted attacks.

Why this answer

Exposing internal IP addresses in error messages is a classic example of a security misconfiguration (C). The web application is likely configured to output detailed error messages (e.g., stack traces or debug information) that include internal network details, which should be suppressed in production environments. This violates the principle of least information disclosure and is categorized under security misconfiguration because it stems from improper default or runtime settings.

Exam trap

The trap here is that candidates confuse the disclosure of internal IP addresses with 'sensitive data exposure' (B), but CISSP categorizes this under security misconfiguration because the root cause is a failure to properly configure error handling, not the inherent sensitivity of the data itself.

How to eliminate wrong answers

Option A is wrong because broken access control refers to failures in enforcing user permissions (e.g., accessing unauthorized resources via path traversal or privilege escalation), not the inadvertent disclosure of internal network information in error outputs. Option B is wrong because sensitive data exposure typically involves the exposure of protected data such as passwords, credit card numbers, or PII, whereas internal IP addresses are not classified as sensitive data under most regulatory frameworks (e.g., GDPR, PCI DSS) unless they reveal system architecture that could aid an attacker. Option D is wrong because insecure deserialization involves the manipulation of serialized objects to execute arbitrary code or bypass authentication, which is unrelated to the verbosity of error messages.

11
MCQmedium

A security analyst is reviewing a web application and notices that it includes a feature that allows users to view their own profile by providing a user ID in the URL (e.g., /profile?userid=123). The application does not verify that the logged-in user owns that profile. Which vulnerability is present?

A.Security misconfiguration
B.Cross-site scripting (XSS)
C.Insecure direct object reference (IDOR)
D.Cross-site request forgery (CSRF)
AnswerC

Insecure direct object reference (IDOR) occurs when a web application exposes a direct reference to an internal implementation object, such as a file, directory, or database key, and fails to verify that the user is authorized to access that object. Attackers can manipulate these references, often found in URL parameters or form fields, to access or modify data belonging to other users or system files. The scenario directly aligns with an IDOR vulnerability, as it involves bypassing authorization by directly referencing an object.

Why this answer

Insecure Direct Object References (IDOR) occur when an application exposes direct references to internal objects (like user IDs) without proper access control checks. This allows an attacker to access other users' data by manipulating the ID.

12
MCQmedium

A security team is reviewing a web application that allows users to search for products. The application uses a SQL database and constructs queries by concatenating user input directly into the SQL statement. Which of the following is the most effective mitigation against SQL injection attacks?

A.Using parameterized queries with prepared statements
B.Escaping all user input before concatenation
C.Input validation using a blacklist of known malicious patterns
D.Implementing a Web Application Firewall (WAF)
AnswerA

Parameterized queries with prepared statements are the most effective defense against SQL injection because they fundamentally separate the SQL code structure from user-provided data. The database engine treats all input as literal values, not executable commands, preventing malicious input from altering the query's intent. This architectural separation ensures that special characters in user input are never interpreted as SQL syntax, thereby eliminating the injection vector at its root.

Why this answer

Parameterized queries with prepared statements separate SQL logic from user input by sending the query structure to the database first, then binding input values as data parameters. This prevents the database from interpreting user input as executable SQL code, even if the input contains malicious characters. It is the only defense that completely eliminates the injection vector at the database interaction layer.

Exam trap

The trap here is that candidates often choose input validation or escaping because they seem proactive, but the CISSP exam emphasizes that parameterized queries are the only definitive defense against SQL injection at the code level, as they enforce separation of code and data by design.

How to eliminate wrong answers

Option B is wrong because escaping user input is error-prone and context-dependent; an attacker can bypass escaping if the escape function is not perfectly aligned with the database's character set or query context (e.g., using alternate encodings or second-order injection). Option C is wrong because blacklist-based input validation can be circumvented by obfuscation techniques (e.g., using hex, Unicode, or case variations) and fails to block novel or unknown attack patterns. Option D is wrong because a WAF operates at the network or application layer and can only detect known attack signatures; it cannot prevent injection if the underlying code still concatenates input, and it can be bypassed by encoding or timing attacks.

13
MCQeasy

Which of the following is a secure coding practice to prevent SQL injection attacks?

A.Escaping all user input
B.Using parameterized queries
C.Using stored procedures exclusively
D.Validating input length
AnswerB

Parameterized queries, also known as prepared statements, are a highly effective secure coding practice for preventing SQL injection. They work by defining the SQL query structure with placeholders for data, which are then passed separately to the database engine. This strict separation ensures that user-supplied input is always treated as data values, never as executable SQL code, thus neutralizing any embedded malicious commands.

Why this answer

Parameterized queries (also known as prepared statements) separate SQL code from data by using placeholders (e.g., '?' in ODBC/JDBC or ':param' in Oracle) that are bound to user-supplied values at execution time. This ensures that input is always treated as data, never as executable SQL syntax, effectively neutralizing SQL injection regardless of the input content.

Exam trap

The trap here is that candidates often confuse 'stored procedures' with being inherently secure, but the CISSP exam tests that stored procedures can still be vulnerable if they use dynamic SQL with concatenated input, whereas parameterized queries (or prepared statements) are the definitive defense.

How to eliminate wrong answers

Option A is wrong because escaping all user input is error-prone and context-dependent; different database systems require different escape characters (e.g., backslash in MySQL vs. doubling single quotes in SQL Server), and incomplete or incorrect escaping can still allow injection. Option C is wrong because stored procedures alone do not prevent SQL injection if they contain dynamic SQL built with string concatenation (e.g., EXECUTE IMMEDIATE in Oracle or sp_executesql with concatenated parameters in SQL Server). Option D is wrong because validating input length only restricts the size of the input, not its content; an attacker can still inject malicious SQL within a valid length limit (e.g., a 10-character string like '1 OR 1=1').

14
MCQhard

A company is evaluating a third-party software library for use in their application. Which document provides a detailed inventory of the library's components and dependencies to help assess supply chain risk?

A.Service Level Agreement (SLA)
B.Data processing agreement
C.Vulnerability disclosure report
D.Software Bill of Materials (SBOM)
AnswerD

A Software Bill of Materials (SBOM) is a formal, machine-readable inventory of all software components, including open-source and commercial elements, and their dependencies used in a product. It provides critical transparency into the software supply chain, enabling organizations to proactively identify and track known vulnerabilities, licensing obligations, and potential risks associated with third-party libraries, which is essential for comprehensive risk assessment.

Why this answer

A Software Bill of Materials (SBOM) lists all components and dependencies, aiding vulnerability management and supply chain security.

15
MCQeasy

Which type of security testing involves analyzing source code for vulnerabilities without executing the code?

A.SAST
B.Penetration testing
C.IAST
D.DAST
AnswerA

SAST (Static Application Security Testing) is a white-box testing methodology that directly analyzes an application's source code, bytecode, or binary code for security vulnerabilities without actually executing the program. It identifies potential flaws such as SQL injection, cross-site scripting (XSS), buffer overflows, and insecure direct object references by examining code patterns and data flows. This static analysis occurs early in the Software Development Life Cycle (SDLC), allowing developers to fix issues before deployment.

Why this answer

SAST (Static Application Security Testing) analyzes source code, bytecode, or binary code for security vulnerabilities without executing the program. It operates by scanning the codebase for patterns known to be insecure (e.g., SQL injection via string concatenation) using techniques like data flow analysis, taint tracking, and pattern matching, all performed at rest.

Exam trap

The trap here is that candidates confuse SAST with DAST because both are 'security testing' acronyms, but the key differentiator is that SAST analyzes code without execution (static), while DAST requires a running application (dynamic).

How to eliminate wrong answers

Option B is wrong because penetration testing is a dynamic, manual or automated process that tests a running application or system by simulating attacks, not by analyzing static source code. Option C is wrong because IAST (Interactive Application Security Testing) combines static and dynamic analysis by instrumenting the application and monitoring its behavior during runtime execution, not by analyzing code without execution. Option D is wrong because DAST (Dynamic Application Security Testing) tests an application while it is running, typically by sending malicious payloads and observing responses, which requires execution and does not involve source code analysis.

16
MCQhard

During a penetration test, a security analyst discovers that a web application allows an attacker to bypass authorization and view another user's private messages by simply changing a numeric ID in the URL. Which vulnerability is being exploited?

A.Broken authentication
B.Insecure direct object reference (IDOR)
C.Server-side request forgery (SSRF)
D.Security misconfiguration
AnswerB

Insecure direct object reference (IDOR) occurs when an application exposes a direct reference to an internal implementation object, such as a file, database key, or directory, and fails to implement sufficient authorization checks. An attacker can manipulate these references, often found in URL parameters or request bodies, to access or modify resources belonging to other users or system components without explicit permission. This directly aligns with a penetration test discovery where an analyst accesses unauthorized objects by altering an identifier.

Why this answer

B is correct because the vulnerability allows an attacker to access another user's private messages by simply changing a numeric ID in the URL, which is a classic example of Insecure Direct Object Reference (IDOR). This occurs when the application exposes a direct reference to an internal object (e.g., a database key) without proper access control checks, enabling unauthorized access to resources belonging to other users.

Exam trap

The trap here is that candidates confuse IDOR with broken authentication because both involve unauthorized access, but IDOR specifically targets direct object references without proper access controls, whereas broken authentication focuses on flaws in the authentication process itself.

How to eliminate wrong answers

Option A is wrong because broken authentication refers to flaws in session management, credential handling, or login mechanisms (e.g., weak password policies, session fixation), not the direct manipulation of object references in URLs. Option C is wrong because Server-Side Request Forgery (SSRF) involves an attacker inducing the server to make requests to internal or external resources, not directly accessing another user's data via a modified URL parameter. Option D is wrong because security misconfiguration covers issues like default credentials, unnecessary services, or verbose error messages, but does not specifically describe the lack of authorization checks on object references.

17
MCQeasy

Which of the following is the primary purpose of output encoding in web application security?

A.Preventing buffer overflow attacks
B.Preventing cross-site request forgery (CSRF)
C.Preventing cross-site scripting (XSS) attacks
D.Preventing SQL injection attacks
AnswerC

Output encoding is the fundamental defense against cross-site scripting (XSS) attacks, which involve injecting malicious client-side scripts into web pages. By transforming potentially dangerous characters like angle brackets (<, >) and quotes (", ') into their safe entity equivalents (e.g., &lt;, &gt;), output encoding ensures that user-supplied input is always interpreted as inert data. This prevents the browser from executing the injected content as active code, thereby neutralizing the XSS payload before it can affect other users.

Why this answer

Output encoding is the practice of converting special characters (e.g., <, >, &, ") into their corresponding HTML entities (e.g., &lt; &gt; &amp; &quot;) before sending data to the browser. This ensures that any user-supplied data is treated as text, not executable code, thereby neutralizing injected scripts. It is the primary defense against stored, reflected, and DOM-based cross-site scripting (XSS) attacks because it breaks the parser's ability to interpret the data as active content.

Exam trap

The trap here is that candidates confuse output encoding with input validation or sanitization, mistakenly thinking it prevents SQL injection or CSRF, but output encoding only neutralizes XSS by ensuring data is rendered as text in the browser, not as executable code.

How to eliminate wrong answers

Option A is wrong because buffer overflow attacks are prevented by bounds checking, input validation, and safe memory functions (e.g., strncpy instead of strcpy), not by output encoding, which operates on output to browsers, not on memory buffers. Option B is wrong because CSRF is prevented by anti-CSRF tokens (e.g., synchronizer tokens or SameSite cookies), not by output encoding, which does not validate the origin or authenticity of requests. Option D is wrong because SQL injection is prevented by parameterized queries (prepared statements) or stored procedures, not by output encoding, which applies to HTML/JavaScript contexts, not to database query construction.

18
MCQmedium

A development team is designing a new application and wants to ensure that if a failure occurs, the system remains secure by default. Which design principle should they apply?

A.Least privilege
B.Defense in depth
C.Separation of duties
D.Fail-secure
AnswerD

Fail-secure, also known as fail-safe, is a critical design principle ensuring that if a system component or process fails, the system defaults to a state that denies access or prevents operations, thus maintaining security. For instance, a locked door remains locked if power fails, or an authentication system denies all access if its backend database becomes unavailable. This approach prioritizes security over availability during a failure event, directly addressing how an application should behave to protect data and resources.

Why this answer

Fail-secure ensures that when a system fails, it defaults to a secure state (e.g., denying access) rather than an insecure one.

19
MCQmedium

A security architect is reviewing a design for an e-commerce application. The architect recommends implementing defense in depth. Which of the following is an example of this principle?

A.Encrypting data at rest only
B.Implementing both a web application firewall (WAF) and input validation
C.Using a single firewall at the network perimeter
D.Requiring strong passwords for all users
AnswerB

This option correctly demonstrates defense in depth by combining two distinct and complementary security controls. A Web Application Firewall (WAF) provides an external, perimeter-like defense, filtering malicious requests before they reach the application server, while input validation acts as an internal, application-level control, ensuring that only safe and properly formatted data is processed. This layered approach significantly reduces the attack surface and effectively mitigates a broader spectrum of web-based threats, such as SQL injection and cross-site scripting, by providing multiple points of enforcement.

Why this answer

Defense in depth uses multiple layers of security controls so that if one fails, others still provide protection.

20
MCQmedium

A development team is implementing a web application that allows users to search for products. To prevent SQL injection attacks, which secure coding practice should be applied?

A.Input validation using a blacklist of SQL keywords
B.Parameterized queries with prepared statements
C.Output encoding of user input
D.Using stored procedures exclusively
AnswerB

Parameterized queries with prepared statements are the most effective defense against SQL injection vulnerabilities. By separating the SQL code from user-supplied data, the database engine can distinguish between the query structure and the values to be inserted, updated, or retrieved. This mechanism ensures that user input is always treated as literal data, preventing it from being interpreted as executable SQL commands.

Why this answer

Parameterized queries with prepared statements (Option B) are the definitive defense against SQL injection because they separate SQL logic from user-supplied data. The database engine compiles the query structure first, then binds input values as parameters, ensuring that malicious input cannot alter the intended SQL command. This approach is language-agnostic and works across all modern database interfaces (e.g., JDBC, PDO, ADO.NET).

Exam trap

The trap here is that candidates often confuse stored procedures as a silver bullet for SQL injection, failing to realize that the security lies in how parameters are bound, not in the procedure container itself.

How to eliminate wrong answers

Option A is wrong because blacklisting SQL keywords is inherently incomplete and easily bypassed; attackers can use encoding, comments, or alternative syntax (e.g., CHAR(), CONCAT()) to evade the filter. Option C is wrong because output encoding (e.g., HTML entity encoding) is designed to prevent cross-site scripting (XSS), not SQL injection, which occurs at the database layer before output is rendered. Option D is wrong because stored procedures alone do not prevent SQL injection if dynamic SQL is constructed within the procedure; the protection comes only when parameters are used inside the stored procedure, not from the procedure itself.

21
MCQhard

A development team is implementing cryptographic functions for a new application. They need to store passwords securely. Which of the following is the most appropriate approach?

A.Use a key derivation function (e.g., bcrypt) with a per-user salt
B.Encrypt passwords using AES-256 with a static key
C.Store passwords in plaintext but in a protected database
D.Hash passwords with SHA-256 without salt
AnswerA

Using a key derivation function (KDF) like bcrypt with a per-user salt is the most secure method for storing passwords. Bcrypt is specifically designed to be computationally intensive and slow, making brute-force attacks economically infeasible by requiring significant processing power for each guess. The unique, randomly generated per-user salt ensures that even identical passwords produce different hashes, effectively neutralizing precomputed rainbow table attacks and dictionary attacks across multiple user accounts.

Why this answer

Passwords should be salted and hashed using a strong, slow hash function like bcrypt, scrypt, or PBKDF2. Salting prevents rainbow table attacks.

22
Multi-Selectmedium

A security architect is reviewing a web application's design and identifies several potential vulnerabilities. Which TWO of the following are effective mitigations for cross-site scripting (XSS) attacks?

Select 2 answers
A.Enabling Content Security Policy (CSP)
B.Using CSRF tokens
C.Disabling client-side scripts entirely
D.Implementing parameterized queries
E.Using output encoding
AnswersA, E

Content Security Policy (CSP) is a crucial security mechanism that allows web administrators to define trusted sources for content, such as scripts, stylesheets, and images, that a user agent is permitted to load for a given page. By restricting script execution to only approved origins, CSP significantly mitigates Cross-Site Scripting (XSS) attacks, preventing browsers from executing malicious scripts injected from untrusted sources, even if an injection vulnerability exists. This policy acts as a powerful, browser-enforced second layer of defense.

Why this answer

Output encoding ensures user input is treated as data, and Content Security Policy (CSP) restricts sources of executable scripts. Input validation can help but is not as effective alone; whitelist validation is emphasized, but output encoding and CSP are primary defenses.

23
MCQhard

A development team is fixing a stored cross-site scripting (XSS) vulnerability in a web application that displays user comments. The application stores comments in a database and renders them in HTML. Which of the following is the most secure approach to prevent XSS?

A.Use Content Security Policy (CSP) headers to restrict script execution
B.Sanitize input by removing all HTML tags before storing
C.Apply output encoding based on the context (e.g., HTML entity encoding)
D.Store comments in a separate domain to isolate them
AnswerC

Applying output encoding, specifically HTML entity encoding for HTML contexts, is the most effective and robust solution for preventing stored Cross-Site Scripting (XSS). This process transforms malicious characters (like <, >, &, ", ') into their safe, non-executable representations before rendering them in the browser. By ensuring that user-supplied data is treated as data, not executable code, the browser interprets the encoded script as harmless text, thereby neutralizing the XSS payload.

Why this answer

Output encoding (C) is the most secure approach because it neutralizes malicious scripts at the point of rendering, ensuring that user-controlled data is treated as text rather than executable code. For HTML contexts, HTML entity encoding (e.g., `&lt;script&gt;`) prevents the browser from interpreting injected tags, regardless of how the data was stored. This aligns with the defense-in-depth principle and is the primary mitigation for stored XSS as recommended by OWASP.

Exam trap

A common misconception is that input sanitization (removing tags) is the best approach, but the CISSP emphasizes that output encoding is the definitive control because it works regardless of how data enters the system and preserves data integrity for legitimate use.

How to eliminate wrong answers

Option A is wrong because CSP is a defense-in-depth layer that can restrict script execution, but it does not fix the root cause—malicious data remains in the database and could still be exploited if CSP is misconfigured or bypassed (e.g., via JSONP or older browser versions). Option B is wrong because removing all HTML tags before storing destroys legitimate formatting (e.g., bold, lists) and is overly restrictive; a more nuanced sanitization (e.g., whitelist-based) is possible, but output encoding is still needed as a final safeguard. Option D is wrong because storing comments on a separate domain does not prevent XSS—the comments are still rendered in the original application's HTML context, and the same-domain origin policy does not block script execution from injected content.

24
MCQhard

An organization is migrating to a new application that uses serialized objects to transfer data between services. The security team is concerned about insecure deserialization attacks. Which of the following controls is most effective in preventing deserialization vulnerabilities?

A.Applying cryptographic integrity checks (e.g., HMAC) to serialized objects
B.Implementing input validation on deserialized data
C.Using a allowlist of classes allowed to be deserialized
D.Running deserialization in a sandboxed environment
AnswerA

When serialized objects are transmitted or stored, an attacker might tamper with the serialized data to inject malicious code or alter object properties. Applying a cryptographic integrity check, such as a Hash-based Message Authentication Code (HMAC), to the serialized object ensures that any unauthorized modification to the data will be detected prior to deserialization. If the integrity check fails, the system can reject the object, preventing the execution of manipulated or malicious payloads embedded within the serialized stream. This effectively prevents the deserialization of tampered objects.

Why this answer

Integrity checks (e.g., digital signatures) ensure that serialized data has not been tampered with, preventing malicious objects from being deserialized.

25
MCQeasy

What is the primary purpose of a Web Application Firewall (WAF) in a deployment environment?

A.Encrypting all web traffic
B.Filtering malicious HTTP traffic
C.Managing user authentication
D.Performing vulnerability scanning
AnswerB

Filtering malicious HTTP traffic is the core and primary purpose of a Web Application Firewall (WAF). A WAF inspects incoming HTTP/HTTPS requests and outgoing responses at the application layer (Layer 7) for signatures and behaviors indicative of common web attacks, such as SQL injection, cross-site scripting (XSS), and other OWASP Top 10 threats. By analyzing the content, headers, and parameters, the WAF can block or alert on malicious requests before they reach the web application, thereby protecting it from exploitation.

Why this answer

A WAF filters, monitors, and blocks HTTP traffic to and from a web application. It helps protect against common web attacks like SQL injection, XSS, and CSRF by analyzing traffic at the application layer.

26
MCQmedium

During a threat modeling session for a new online banking application, the team uses the STRIDE methodology. Which threat category addresses the risk of an attacker modifying transaction data in transit?

A.Information Disclosure
B.Tampering
C.Elevation of Privilege
D.Spoofing
AnswerB

Tampering specifically refers to the unauthorized modification or alteration of data, whether in transit or at rest, within an application or system. For an online banking application, this could manifest as an attacker changing transaction amounts, recipient details, account balances, or system logs, directly compromising the integrity of financial data and operational processes. This threat directly targets the trustworthiness and accuracy of information, making it a primary concern for financial systems.

Why this answer

Tampering refers to the malicious modification of data. STRIDE's 'T' stands for Tampering.

27
MCQhard

During a vulnerability assessment, a security analyst discovers that a web application uses a library known to be vulnerable to Log4Shell (CVE-2021-44228). Which type of vulnerability does this represent?

A.Server-side request forgery (SSRF)
B.Vulnerable components
C.Insecure deserialization
D.Security misconfiguration
AnswerB

Vulnerable components refer to weaknesses found within third-party libraries, frameworks, or modules that are integrated into an application. The Log4Shell vulnerability (CVE-2021-44228) is a quintessential example, where a critical remote code execution flaw existed within the widely used Apache Log4j logging library itself. Discovering a flaw in a logging library directly aligns with identifying a vulnerable component, as the application's security posture is compromised by a defect in one of its constituent parts.

Why this answer

Log4Shell is a remote code execution vulnerability in the Log4j library, an example of using vulnerable components (third-party libraries with known vulnerabilities).

28
MCQeasy

Which of the following is an example of an Insecure Direct Object Reference (IDOR) vulnerability?

A.An attacker intercepts session cookies to impersonate a user
B.An attacker uses a SQL injection to retrieve data from the database
C.An attacker submits a cross-site request forgery (CSRF) token to perform actions
D.An attacker changes the user ID parameter in a URL to view another user's profile
AnswerD

This is a classic example of an Insecure Direct Object Reference (IDOR). The application directly exposes a reference to an internal implementation object, such as a user ID in a URL parameter, without adequately verifying the user's authorization to access that specific object. By simply modifying the user ID parameter, the attacker can bypass access controls and retrieve or manipulate data belonging to other users, demonstrating a critical authorization flaw.

Why this answer

IDOR occurs when an application exposes a direct reference to an internal object (e.g., database key) and does not verify the user's authorization to access that object.

29
Multi-Selecthard

An organization is acquiring a third-party software product. Which THREE of the following should be included in the security assessment of the vendor?

Select 3 answers
A.Vulnerability scanning of dependencies
B.Reviewing the Software Bill of Materials (SBOM)
C.Verifying software license compliance
D.Performing a vendor security assessment
E.Ensuring code signing is used in the vendor's development process
AnswersA, B, D

Vulnerability scanning of dependencies is a critical security measure when acquiring third-party software. Modern applications extensively rely on open-source and commercial libraries, which frequently contain known vulnerabilities (CVEs). Scanning tools automate the process of identifying these susceptible components by comparing them against comprehensive vulnerability databases, providing an essential and immediate assessment of the acquired product's underlying security posture and potential exploitability.

Why this answer

Reviewing the SBOM, vulnerability scanning of dependencies, and vendor security assessments are key elements of third-party security evaluation. Code signing is a deployment control, not assessment; license compliance is legal but not security-specific.

30
MCQmedium

During the requirements gathering phase of a secure SDLC, the team uses a threat modeling approach that focuses on identifying threats such as spoofing, tampering, and denial of service. Which threat modeling methodology is being employed?

A.PASTA
B.Trike
C.STRIDE
D.OCTAVE
AnswerC

STRIDE is a mnemonic developed by Microsoft that provides a systematic framework for categorizing and identifying common types of threats against software and systems. Each letter represents a specific threat category: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege. This framework is exceptionally useful during the requirements gathering phase of the SDLC to proactively identify potential vulnerabilities and design security controls that directly mitigate these well-defined threat types.

Why this answer

STRIDE is a threat modeling framework developed by Microsoft that categorizes threats into six categories: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege.

31
MCQeasy

A security architect is designing a system that must continue to function even when a component fails. The architect implements multiple layers of security controls so that if one fails, others still provide protection. Which principle is being applied?

A.Separation of duties
B.Defense in depth
C.Fail-secure
D.Least privilege
AnswerB

This robust security strategy involves implementing multiple, independent, and overlapping security controls across various layers of an information system's architecture. By integrating administrative, technical, and physical safeguards, it ensures that if one control fails or is circumvented, other controls are still in place to detect, delay, or prevent an attack. This layered approach significantly increases the complexity and resources required for an adversary to achieve their objectives.

Why this answer

Defense in depth (B) is the correct principle because it involves implementing multiple layers of security controls (e.g., firewalls, intrusion detection systems, encryption, access controls) so that if one layer fails or is bypassed, other layers continue to provide protection, ensuring the system remains functional. This directly matches the scenario where the architect designs for continued operation despite component failure by layering controls.

Exam trap

The trap here is that candidates confuse 'defense in depth' with 'fail-secure' because both involve planning for failure, but fail-secure prioritizes security over availability (e.g., locking down on failure) whereas defense in depth prioritizes continued operation through redundancy of controls.

How to eliminate wrong answers

Option A is wrong because separation of duty is a principle that prevents fraud or error by requiring multiple individuals to complete a sensitive task (e.g., one person authorizes, another executes), not by layering controls for resilience. Option C is wrong because fail-secure means that when a component fails, the system defaults to a secure state (e.g., locking all doors on power loss), which may actually halt functionality rather than ensure continued operation. Option D is wrong because least privilege restricts users or processes to only the minimum permissions needed to perform their tasks, which is a access control principle unrelated to maintaining function during component failures.

32
Multi-Selecteasy

A security analyst is reviewing the authentication mechanism of a web application. Which TWO of the following are examples of broken authentication vulnerabilities?

Select 2 answers
A.Insecure direct object reference in profile URLs
B.Verbose error messages disclosing user IDs
C.Lack of multi-factor authentication for sensitive actions
D.Session timeout set to 60 minutes
E.Allowing weak passwords without complexity requirements
AnswersC, E

The absence of multi-factor authentication (MFA) for sensitive actions constitutes a significant broken authentication vulnerability. MFA requires users to provide two or more distinct verification factors to gain access, substantially increasing the difficulty for unauthorized users to compromise an account even if one factor (like a password) is stolen. Without MFA, a single compromised credential can grant full access to critical functions, directly weakening the authentication process for high-value operations.

Why this answer

Allowing weak passwords (e.g., 'password123') and not having multi-factor authentication (MFA) are broken authentication issues. Session timeout is a security control, not a vulnerability. Verbose error messages are a misconfiguration, and IDOR is an access control issue.

33
Multi-Selectmedium

A security analyst is reviewing a web application that handles financial transactions. Which TWO of the following are effective controls against Cross-Site Request Forgery (CSRF)?

Select 2 answers
A.Setting cookies with the SameSite attribute to Strict
B.Using anti-CSRF tokens in forms
C.Using HTTPS for all pages
D.Enforcing strong password policies
E.Implementing input validation on all user inputs
AnswersA, B

The SameSite=Strict attribute on cookies ensures that the browser will only send the cookie with requests originating from the same site as the cookie's domain. This effectively prevents a malicious third-party site from tricking a user's browser into sending authenticated requests to the legitimate application, thereby mitigating Cross-Site Request Forgery (CSRF) attacks. It provides a robust defense by restricting cookie transmission to first-party contexts only.

Why this answer

CSRF tokens are unique per request and validate the source, while SameSite cookies restrict cookie sending to same-site requests.

34
MCQeasy

A software development team is adopting secure coding practices. They decide to implement input validation for all user-supplied data. Which approach is recommended as the most effective for preventing injection attacks?

A.Encoding input before processing
B.Using regular expressions to sanitize input
C.Blacklist validation to block known malicious patterns
D.Whitelist validation to allow only known good patterns
AnswerD

Whitelist validation is considered the most robust and secure approach for handling user input. This method explicitly defines and permits only a specific set of known-good, expected characters, formats, or values that the application is designed to accept. Any input that deviates from this precisely defined safe set is rejected by default. This proactive "allow-by-default" strategy effectively prevents unknown or novel attack vectors, as anything not explicitly allowed is implicitly denied, making it highly resilient against various injection and manipulation attempts.

Why this answer

Whitelist (allowlist) validation defines acceptable input patterns and rejects everything else, which is more effective than trying to block malicious patterns.

35
Multi-Selectmedium

An organization is planning to acquire a new SaaS application for customer relationship management. Which THREE of the following should be included in the vendor security assessment?

Select 3 answers
A.Checking license compliance for open source components
B.Reviewing the vendor's security certifications (e.g., SOC 2, ISO 27001)
C.Requesting a Software Bill of Materials (SBOM)
D.Assessing the vendor's incident response process
E.Requiring employee security training records
AnswersB, C, D

Reviewing a vendor's security certifications, such as SOC 2 or ISO 27001, provides independent assurance that the vendor has implemented and maintains robust security controls. These certifications indicate that an external auditor has verified the effectiveness of the vendor's information security management system (ISMS) against recognized standards. This offers critical insight into the vendor's commitment to security, data protection, and operational resilience, significantly reducing the acquiring organization's due diligence burden.

Why this answer

Reviewing the vendor's security certifications (e.g., SOC 2), assessing their incident response process, and requesting a Software Bill of Materials (SBOM) are key steps. License compliance is important but not directly security, and employee training is internal to the vendor but less critical than the others.

36
MCQmedium

A web application exposes an API that allows users to fetch data from internal network resources based on a URL parameter. An attacker discovers they can use this API to access internal servers that are not meant to be public. Which vulnerability is being exploited?

A.Insecure direct object reference (IDOR)
B.Remote code execution (RCE)
C.Cross-site request forgery (CSRF)
D.Server-side request forgery (SSRF)
AnswerD

SSRF is exactly this pattern: the API accepts a user-supplied URL or parameter and the server-side code then fetches that resource on the caller's behalf. Because the request originates from the server, it inherits the server's network position and often bypasses firewall rules that would block a direct external request. Attackers abuse this to reach internal-only services, cloud metadata endpoints, or other systems that were never intended to be reachable from outside the network perimeter.

Why this answer

SSRF allows an attacker to induce the server to make requests to internal or external resources, bypassing firewalls and access controls.

37
MCQmedium

An application authenticates users using session tokens. A security analyst finds that the application does not invalidate session tokens after logout, allowing session fixation attacks. Which secure coding practice should be implemented to mitigate this?

A.Using short session timeouts
B.Setting the secure flag on cookies
C.Regenerating session ID after successful login
D.Implementing HTTPS for all communications
AnswerC

Regenerating session ID prevents fixation by ensuring the attacker's session ID is not used.

Why this answer

Proper session management includes invalidating session tokens on logout and generating new tokens after authentication to prevent fixation.

38
Multi-Selectmedium

During a security audit of a web application, the following issues are found: (1) Session tokens are included in URLs, (2) The application does not invalidate session tokens after logout, and (3) Session tokens are predictable. Which THREE of the following controls are most appropriate to address these issues?

Select 3 answers
A.Regenerate session tokens after login
B.Store session tokens in cookies with Secure and HttpOnly flags
C.Invalidate session tokens on logout and set short expiration times
D.Use a cryptographically secure random number generator for token generation
E.Implement IP address binding for session tokens
AnswersB, C, D

Storing session tokens in cookies with the Secure flag ensures they are only transmitted over encrypted HTTPS connections, preventing passive network eavesdropping. The HttpOnly flag prevents client-side scripts, such as JavaScript, from accessing the cookie's content, significantly mitigating the risk of session token theft via Cross-Site Scripting (XSS) attacks. These flags collectively enhance the confidentiality and integrity of session tokens during transit and storage.

Why this answer

Option B is correct because storing session tokens in cookies with Secure and HttpOnly flags addresses the issue of tokens being included in URLs by keeping them out of URLs and providing additional protections. Option C is correct because invalidating session tokens on logout and setting short expiration times directly addresses the lack of invalidation. Option D is correct because using a cryptographically secure random number generator directly addresses the predictability of session tokens.

Option A is incorrect because regenerating session tokens after login is primarily a control against session fixation, not directly addressing predictability, exposure in URLs, or lack of invalidation. Option E is incorrect because IP address binding is fragile and does not protect against token exposure or poor invalidation.

Exam trap

ISC2 often tests the misconception that IP binding is a strong session management control, but in reality it is fragile and not a primary defense against session token exposure, predictability, or improper invalidation.

39
Multi-Selecthard

A security team is planning to integrate security testing into the software development lifecycle. They want to identify vulnerabilities early and often. Which TWO of the following testing methods should be implemented during the development phase (before deployment) to catch code-level vulnerabilities?

Select 2 answers
A.Interactive Application Security Testing (IAST)
B.Penetration testing
C.Vulnerability scanning
D.Static Application Security Testing (SAST)
E.Dynamic Application Security Testing (DAST)
AnswersA, D

IAST is a modern security testing method that instruments the application code and observes its behavior from within during automated or manual functional tests. It provides real-time analysis of application interactions, identifying vulnerabilities with high accuracy by understanding both code execution and data flow. This integration into existing testing processes makes it highly effective for finding flaws early in the development lifecycle.

Why this answer

SAST (Static Application Security Testing) analyzes source code for vulnerabilities without executing it. IAST (Interactive Application Security Testing) combines SAST and DAST by instrumenting the application and analyzing runtime behavior. Both are suitable for development phase.

DAST requires a running application, and penetration testing is usually done later.

40
MCQmedium

A security team is conducting a penetration test on a web application. They identify that the application is vulnerable to reflected cross-site scripting (XSS). Which of the following is the most effective mitigation?

A.Using HTTPS to encrypt traffic
B.Implementing a Content Security Policy (CSP) with strict directives
C.Validating input against a whitelist of allowed characters
D.Encoding all user-supplied data before reflecting it in the response
AnswerD

Encoding all user-supplied data before reflecting it in the response is the primary and most effective defense against reflected Cross-Site Scripting (XSS) attacks. This process transforms potentially malicious characters (e.g., '<', '>', '&') into their safe, non-executable HTML entity equivalents (e.g., '&lt;', '&gt;', '&amp;'). By ensuring the browser interprets user input as inert data rather than executable code, this practice directly prevents the injection and execution of malicious scripts within the user's browser.

Why this answer

Reflecting user-supplied data without proper encoding allows an attacker to inject arbitrary HTML/JavaScript that executes in the victim's browser. Output encoding (e.g., HTML entity encoding for context like <script> to &lt;script&gt;) neutralizes the injected script by treating it as data rather than executable code. This directly addresses the root cause of reflected XSS—failure to separate user input from executable content in the response.

Exam trap

The trap here is that candidates often confuse input validation (Option C) with output encoding, but the CISSP emphasizes that output encoding is the definitive control for injection flaws because it ensures data is treated as data regardless of input validation failures.

How to eliminate wrong answers

Option A is wrong because HTTPS encrypts data in transit but does not prevent the server from reflecting malicious input in the response; the XSS payload still executes in the browser after decryption. Option B is wrong because while CSP can mitigate XSS by restricting script sources, it is a defense-in-depth control and not the most effective primary mitigation—it can be bypassed if the application reflects user input into inline script contexts or if CSP is misconfigured (e.g., using 'unsafe-inline'). Option C is wrong because input validation against a whitelist is effective for input validation but does not guarantee safety when data is reflected; an attacker may bypass the whitelist or inject via other input channels, and output encoding is required regardless of input validation.

Ready to test yourself?

Try a timed practice session using only Software Development Security questions.