SE Secure Software Development and Application Security 1 — Questions and Answers
Question 1: Which OWASP Top 10 category covers weaknesses in authentication mechanisms that allow attackers to compromise passwords, keys, or session tokens?
- Injection
- Broken Access Control
- Identification and Authentication Failures (Correct answer)
- Cryptographic Failures
Correct answer: Identification and Authentication Failures
OWASP A07:2021 - Identification and Authentication Failures covers weaknesses that allow attackers to compromise user identity through flawed login, session, or credential management.
Question 2: What is the most effective defense against SQL injection attacks in application code?
- Input length validation
- Parameterized queries (prepared statements) (Correct answer)
- Encrypting database connections
- Using stored procedures exclusively
Correct answer: Parameterized queries (prepared statements)
Parameterized queries separate SQL code from user-supplied data, preventing input from being interpreted as SQL syntax regardless of its content.
Question 3: Which type of Cross-Site Scripting (XSS) attack permanently stores the malicious script on the target server?
- Reflected XSS
- DOM-based XSS
- Stored XSS (Correct answer)
- Blind XSS
Correct answer: Stored XSS
Stored XSS (Persistent XSS) saves the malicious script in the server's database or file system, causing it to execute for every user who views the affected page.
Question 4: What security principle requires each application component to operate with only the minimum permissions necessary to perform its function?
- Defense in Depth
- Separation of Duties
- Principle of Least Privilege (Correct answer)
- Zero Trust Architecture
Correct answer: Principle of Least Privilege
The Principle of Least Privilege limits access rights and permissions of software components to the absolute minimum required, reducing the attack surface if a component is compromised.
Question 5: Which vulnerability occurs when an application passes user-controlled input to a system command interpreter without proper sanitization?
- Path Traversal
- Command Injection (Correct answer)
- Remote File Inclusion
- XML External Entity (XXE)
Correct answer: Command Injection
Command injection allows attackers to execute arbitrary OS commands by embedding them in user input that the application passes to a system shell.
Question 6: What is Server-Side Request Forgery (SSRF)?
- An attack that forces a server to make requests to unintended internal or external locations (Correct answer)
- An attack that forges server-side TLS certificates
- A method to bypass server authentication using crafted HTTP requests
- A technique to intercept encrypted server-to-server communications
Correct answer: An attack that forces a server to make requests to unintended internal or external locations
SSRF induces the server-side application to make HTTP requests to arbitrary domains, potentially exposing internal services not accessible from the internet.
Question 7: Which of the following best describes a 'cryptographic failure' as defined by OWASP?
- Using an expired TLS certificate on a public-facing server
- Failing to encrypt sensitive data or using weak/broken cryptographic algorithms (Correct answer)
- Implementing two-factor authentication with a weak second factor
- Using self-signed certificates in a production environment
Correct answer: Failing to encrypt sensitive data or using weak/broken cryptographic algorithms
OWASP A02:2021 Cryptographic Failures occur when sensitive data is exposed due to absent encryption or the use of deprecated and weak cryptographic algorithms.
Which OWASP Top 10 category covers weaknesses in authentication mechanisms that allow attackers to compromise passwords, keys, or session tokens?