


















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



















































































Question 1. Which component of the CIA triad primarily addresses the need to prevent unauthorized disclosure of data? A) Integrity B) Availability C) Confidentiality D) Authentication Answer: C Explanation: Confidentiality ensures that information is not disclosed to unauthorized individuals, which directly addresses preventing unauthorized disclosure. Question 2. In the principle of least privilege, a developer should grant a user or process the minimum permissions necessary to: A) Perform any future task B) Execute only the required operation C) Access all system resources D) Bypass security controls Answer: B Explanation: Least privilege limits permissions to only what is needed for the specific operation, reducing the attack surface. Question 3. Which security design principle emphasizes that a system should be simple enough to be easily understood and verified? A) Fail‑Safe Defaults B) Economy of Mechanism C) Complete Mediation D) Psychological Acceptability Answer: B
Explanation: Economy of Mechanism advocates for simplicity, making it easier to audit and maintain secure code. Question 4. Under GDPR, personal data must be processed with: A) Unlimited retention B) No consent required C) Purpose limitation and data minimization D) Open public access Answer: C Explanation: GDPR requires that personal data be collected for specified, explicit purposes and that only the minimum necessary data be processed. Question 5. Which of the following is a legal responsibility of a software developer under HIPAA? A) Encrypting all code files B) Ensuring electronic protected health information (ePHI) is secured C) Publishing source code publicly D) Disabling all logging functions Answer: B Explanation: HIPAA mandates that developers protect ePHI through appropriate technical safeguards, including encryption and access controls. Question 6. During the requirements phase of an S‑SDLC, a team should create which artifact to capture potential misuse? A) Data flow diagram B) Abuse case model C) Unit test plan
Answer: B Explanation: The CERT C Secure Coding Standard provides guidelines specifically for writing secure C and C++ code. Question 10. A peer code review aims to detect: A) Only functional bugs B) Security vulnerabilities, logic errors, and style issues C) License violations only D) Performance bottlenecks exclusively Answer: B Explanation: Peer reviews are comprehensive and include security, functional, style, and performance concerns. Question 11. Which testing technique analyzes source code without executing it? A) Dynamic Application Security Testing (DAST) B) Penetration testing C) Static Application Security Testing (SAST) D) Fuzz testing Answer: C Explanation: SAST examines source or binary code statically to find vulnerabilities without running the program. Question 12. In DAST, the scanner interacts with a running application to find: A) Compile‑time errors B) Runtime vulnerabilities such as XSS and SQL injection C) License incompatibilities
D) Memory leaks in test harnesses Answer: B Explanation: DAST tests a live application, sending crafted inputs to uncover runtime security issues. Question 13. Which of the following is a primary goal of a penetration test? A) Verify compliance with coding style guides B) Demonstrate the feasibility of exploiting identified vulnerabilities C) Generate unit test coverage metrics D) Optimize database queries for speed Answer: B Explanation: Penetration testing simulates real attacks to show how vulnerabilities could be exploited. Question 14. Secure configuration management during deployment includes: A) Hard‑coding passwords in source files B) Using default admin credentials C) Storing secrets in environment variables or secret vaults D) Disabling logging to avoid information leakage Answer: C Explanation: Secrets should be managed securely, often via environment variables or dedicated secret management systems. Question 15. An effective incident response plan for software flaws should contain: A) Steps for public relations only B) Procedures for identification, containment, eradication, and recovery C) A list of all developers’ personal email addresses
D) Manual escaping of quotes only Answer: B Explanation: Prepared statements separate code from data, eliminating the injection vector. Question 19. Context‑aware output encoding for XSS mitigation means: A) Encoding everything as Base B) Applying the appropriate encoding based on where the data appears (HTML, JS, CSS, URL) C) Removing all user‑generated content D) Using only HTML entity encoding for all contexts Answer: B Explanation: Different contexts require specific encoders; e.g., HTML entity encoding for HTML, JavaScript escaping for script contexts. Question 20. Which practice helps mitigate command injection vulnerabilities? A) Directly passing user input to system() calls B) Using a whitelist of allowed commands and arguments C) Relying on the operating system’s default PATH D) Disabling input validation altogether Answer: B Explanation: Whitelisting permissible commands and arguments prevents attackers from injecting malicious commands. Question 21. When handling file uploads, which step is NOT recommended? A) Validating MIME type and extension B) Storing files in a directory accessible via the web root C) Renaming files to a random identifier D) Limiting file size to a reasonable maximum
Answer: B Explanation: Storing uploaded files outside the web root prevents direct URL access and reduces risk of execution. Question 22. Which password hashing algorithm is considered memory‑hard and resistant to GPU attacks? A) MD B) SHA‑ 1 C) Argon D) DES Answer: C Explanation: Argon2 is designed to be memory‑intensive, making brute‑force attacks with GPUs more difficult. Question 23. Multi‑Factor Authentication (MFA) typically combines: A) Two passwords B) Something you know, something you have, or something you are C) Two usernames D) A single biometric factor only Answer: B Explanation: MFA uses at least two of the three factors: knowledge, possession, or inherence. Question 24. A secure “Forgot Password” implementation should: A) Send the user’s current password in plain text email B) Provide a password reset token that expires after a short period C) Allow unlimited password reset attempts without verification D) Store reset tokens in plain text in the database
D) Disabling cookies entirely Answer: B Explanation: Issuing a fresh session ID after login prevents an attacker from pre‑setting a session identifier. Question 28. A stack‑based buffer overflow occurs when: A) Heap memory is allocated incorrectly B) Data is written beyond the bounds of a stack‑allocated buffer, overwriting control data C) An integer underflows during arithmetic D) A pointer is freed twice Answer: B Explanation: Stack buffer overflows overwrite adjacent memory on the call stack, often corrupting return addresses. Question 29. Address Space Layout Randomization (ASLR) primarily defends against: A) SQL injection B) Predictable memory address exploitation (e.g., return‑to‑libc) C) Cross‑site scripting D) Weak password storage Answer: B Explanation: ASLR randomizes the locations of executable regions, making it harder for attackers to guess addresses. Question 30. Data Execution Prevention (DEP) blocks: A) Reading of sensitive files B) Execution of code in non‑executable memory regions (e.g., stack, heap) C) Network traffic on port 80
D) Use of weak cryptographic algorithms Answer: B Explanation: DEP marks certain memory pages as non‑executable, preventing injected code from running. Question 31. Which of the following can cause an integer overflow? A) Adding two large positive integers that exceed the maximum value representable B) Subtracting a larger number from a smaller one C) Dividing by zero D) Using floating‑point arithmetic Answer: A Explanation: When the sum exceeds the type’s maximum, the value wraps around, causing overflow. Question 32. To safely convert a signed 32‑bit integer to an unsigned 32‑bit integer in C, a developer should: A) Cast directly without checks B) Verify that the signed value is non‑negative before casting C) Use sprintf to serialize the value D) Multiply by - 1 first Answer: B Explanation: Casting a negative signed integer to unsigned yields a large positive value; checking non‑negativity avoids logic errors. Question 33. A “use‑after‑free” vulnerability arises when: A) Memory is allocated but never freed B) A pointer is dereferenced after the memory it points to has been released
B) Confidentiality and digital signatures C) Data backup and archiving D) Password storage and salting Answer: B Explanation: Public‑key cryptography enables confidential transmission (encryption) and authentication (signatures). Question 37. Which of the following is a common mistake when implementing RSA encryption? A) Using OAEP padding B) Encrypting data larger than the key size without proper padding C. Using a 2048‑bit key D. Generating keys with a cryptographically secure RNG Answer: B Explanation: RSA can only encrypt data up to the key size minus padding overhead; attempting to encrypt larger data leads to errors or insecure practices. Question 38. The term “home‑grown crypto” refers to: A) Using OpenSSL libraries B) Designing proprietary encryption algorithms without peer review C. Implementing AES in hardware D. Using TLS 1. Answer: B Explanation: Custom cryptographic algorithms are discouraged because they lack rigorous analysis and are prone to flaws.
Question 39. Which of the following is a secure way to transmit sensitive data over the internet? A) Plain HTTP B) FTP C) TLS (HTTPS) D. Telnet Answer: C Explanation: TLS encrypts data in transit, protecting confidentiality and integrity. Question 40. In the context of secure coding, “defense in depth” means: A) Using a single firewall at the network perimeter B) Implementing multiple layers of security controls throughout the system C. Relying solely on encryption for protection D. Disabling all user input validation Answer: B Explanation: Defense in depth applies overlapping controls (network, host, application, data) to mitigate failures in any single layer. Question 41. Which design principle states that a system should default to a secure configuration rather than an insecure one? A) Fail‑Safe Defaults B) Open Design C) Least Common Mechanism D) Psychological Acceptability Answer: A Explanation: Fail‑Safe Defaults ensure that the default state is secure, minimizing exposure when settings are not explicitly configured.
Question 45. Which regulatory framework specifically mandates the use of strong encryption for payment card data? A) GDPR B) HIPAA C) PCI‑DSS D) SOX Answer: C Explanation: PCI‑DSS requires encryption of cardholder data during transmission and storage. Question 46. A developer discovers a zero‑day vulnerability in a third‑party library used by the product. The ethically correct action is to: A. Exploit it for personal gain B. Disclose it to the vendor and coordinate a fix before public release C. Ignore it because it is not their code D. Publish the exploit details immediately on a forum Answer: B Explanation: Responsible disclosure involves notifying the vendor, allowing them to patch before the vulnerability becomes public. Question 47. In agile development, security stories are typically placed in the: A. Sprint backlog as “security tasks” that are done in parallel to functional stories B. Only in the final release phase C. Documentation phase exclusively D. None of the above Answer: A
Explanation: Agile teams embed security work into the sprint backlog to address security continuously. Question 48. Which of the following is NOT a typical output of a threat modeling activity? A. Attack trees or attack diagrams B. List of mitigations for identified threats C. Detailed UI mockups for new features D. Prioritized risk ratings (e.g., CVSS) Answer: C Explanation: UI mockups are unrelated to threat modeling; the activity focuses on threats, mitigations, and risk scoring. Question 49. A “security gate” in a CI/CD pipeline commonly performs which function? A. Compiles source code only B. Runs static analysis tools to detect known security patterns before merge C. Deploys directly to production without testing D. Generates documentation automatically Answer: B Explanation: Security gates enforce automated checks (SAST, dependency scanning) to prevent vulnerable code from advancing. Question 50. Which of the following best describes a “sandbox” in application security? A. A production database B. An isolated environment that limits the resources and system calls an app can use C. A backup server D. An encrypted file system Answer: B
Explanation: CSPRNGs produce unpredictable values essential for cryptographic material. Question 54. Which OWASP Top Ten category addresses insecure deserialization? A. A1 – Injection B. A5 – Security Misconfiguration C. A8 – Insecure Deserialization D. A10 – Insufficient Logging & Monitoring Answer: C Explanation: Insecure deserialization is explicitly listed as A8 in the OWASP Top Ten. Question 55. Secure coding guidelines recommend that error messages sent to users should: A. Include full stack traces and internal IDs B. Reveal as little internal detail as possible while still being useful C. Contain the source code of the failing module D. Be omitted entirely Answer: B Explanation: Detailed internal errors can aid attackers; messages should be concise and generic. Question 56. Which of the following is an example of a side‑channel attack? A. SQL injection B. Timing attack on cryptographic operations C. Cross‑site scripting D. Buffer overflow Answer: B Explanation: Timing attacks exploit variations in execution time to infer secret data.
Question 57. In the context of secure software supply chain, a “Software Bill of Materials (SBOM)” provides: A. A list of all third‑party components, versions, and licenses used in a product B. The source code of the application C. The hardware specifications of the server D. The user manual for the software Answer: A Explanation: An SBOM enumerates components, aiding vulnerability management and compliance. Question 58. Which of the following is a recommended practice for handling secrets in source control? A. Store API keys in plain text files committed to the repository B. Use environment variables or secret management tools and exclude them from version control C. Encrypt the entire repository with a weak password D. Include passwords in README files for convenience Answer: B Explanation: Secrets should be kept out of version control and managed securely. Question 59. The principle of “least common mechanism” aims to: A. Share as many resources as possible between users B. Minimize shared components to reduce the risk of unintended interactions C. Encourage code reuse regardless of security impact D. Centralize all authentication to a single service Answer: B