OWASP Top 10 interview questions

25 questions from the OWASP Top 10 course, each with the correct answer and an explanation. Try to answer before you open the answer.

Understanding the OWASP Top 10

1. What is the OWASP Top 10 best described as?

  1. A firewall product
  2. A complete security certification
  3. An awareness document of the most critical web application risk categories
  4. A programming language standard
Show answer

Answer: An awareness document of the most critical web application risk categories

ASVS provides detailed requirements.

Lesson: What the OWASP Top 10 Is

2. Which category was ranked first in the 2021 edition?

  1. Broken Access Control
  2. Injection
  3. Cryptographic Failures
  4. Server-Side Request Forgery
Show answer

Answer: Broken Access Control

Access control problems were the most common in the data.

Lesson: The Categories

3. What does the S in STRIDE stand for?

  1. Storage
  2. Scanning
  3. Session
  4. Spoofing
Show answer

Answer: Spoofing

Pretending to be someone else.

Lesson: Thinking Like a Defender

Broken Access Control and SSRF

4. What is the correct fix for an IDOR vulnerability?

  1. Hide the ID in the URL
  2. Check on the server that the current user may access the requested object
  3. Use POST instead of GET
  4. Disable caching
Show answer

Answer: Check on the server that the current user may access the requested object

Authorisation on every request.

Lesson: Object-Level Authorisation (IDOR)

5. Why is hiding an admin button not enough?

  1. Buttons cannot be hidden
  2. Attackers can call the API endpoint directly
  3. Admins need the button
  4. Browsers block hidden buttons
Show answer

Answer: Attackers can call the API endpoint directly

Enforce on the server.

Lesson: Function-Level Access and CORS

6. Why are cloud metadata endpoints a common SSRF target?

  1. They are always rate limited
  2. They host the public website
  3. They store user passwords in plain text
  4. They can return credentials for the server's cloud identity
Show answer

Answer: They can return credentials for the server's cloud identity

Stolen instance credentials enable further access.

Lesson: Server-Side Request Forgery

Injection and Cross-Site Scripting

7. What is the primary defence against SQL injection?

  1. Parameterised queries
  2. Hiding error messages
  3. Using POST requests
  4. Client-side validation
Show answer

Answer: Parameterised queries

Values never become SQL code.

Lesson: SQL Injection

8. Which DOM property safely inserts untrusted text?

  1. outerHTML
  2. innerHTML
  3. textContent
  4. document.write
Show answer

Answer: textContent

Text is never parsed as HTML.

Lesson: Cross-Site Scripting (XSS)

9. What is the safest way to run an external program with user-supplied input?

  1. Concatenate strings carefully
  2. Use shell=True with quotes
  3. Pass arguments as a list without a shell, after allow-list validation
  4. Run it as root
Show answer

Answer: Pass arguments as a list without a shell, after allow-list validation

Avoid the shell interpreter.

Lesson: Command, Template and Other Injection

Cryptographic Failures and Sensitive Data

10. What does HSTS do?

  1. Tells browsers to use HTTPS only for the site
  2. Encrypts the database
  3. Hashes passwords
  4. Blocks all cookies
Show answer

Answer: Tells browsers to use HTTPS only for the site

Prevents downgrade to HTTP.

Lesson: Encryption in Transit and at Rest

11. Which is appropriate for storing passwords?

  1. Base64 encoding
  2. Unsalted SHA-256
  3. AES encryption with a shared key
  4. Argon2id with a unique salt
Show answer

Answer: Argon2id with a unique salt

Slow, salted, adaptive hashing.

Lesson: Password Storage

12. What should you do first when a secret is committed to a repository?

  1. Only delete the file in the next commit
  2. Revoke and rotate the secret
  3. Make the repository private and do nothing else
  4. Rename the variable
Show answer

Answer: Revoke and rotate the secret

Assume it has been copied.

Lesson: Secrets Management

Insecure Design and Misconfiguration

13. Which is an insecure design flaw rather than a coding bug?

  1. A typo in a variable name
  2. No rate limit on guessing six-digit password reset codes
  3. A missing semicolon
  4. A slow database index
Show answer

Answer: No rate limit on guessing six-digit password reset codes

The control is missing from the design.

Lesson: Insecure Design

14. Which is a security misconfiguration?

  1. Hashing passwords with Argon2id
  2. Using parameterised queries
  3. Enabling HSTS
  4. Running production with debug mode and detailed stack traces enabled
Show answer

Answer: Running production with debug mode and detailed stack traces enabled

Debug output leaks internals.

Lesson: Security Misconfiguration

15. What should happen when an authorisation check throws an unexpected error?

  1. Deny access (fail closed) and log the error
  2. Allow access to avoid annoying users
  3. Show the stack trace to the user
  4. Retry until it succeeds
Show answer

Answer: Deny access (fail closed) and log the error

Errors must not grant access.

Lesson: Security Headers and Error Handling

Components, Integrity and the Supply Chain

16. What is an SBOM?

  1. A password hash format
  2. A type of firewall
  3. An inventory of the components in a piece of software
  4. A cloud region
Show answer

Answer: An inventory of the components in a piece of software

Software bill of materials.

Lesson: Vulnerable and Outdated Components

17. Why is pickle.loads on untrusted data dangerous?

  1. It only supports strings
  2. It is slow
  3. Deserialising pickle data can execute arbitrary code
  4. It deletes the input
Show answer

Answer: Deserialising pickle data can execute arbitrary code

Use data-only formats for untrusted input.

Lesson: Software and Data Integrity Failures

18. What is dependency confusion?

  1. A public package published with the same name as an internal one so builds fetch the attacker's version
  2. Two developers editing the same file
  3. Using too many libraries
  4. A circular import
Show answer

Answer: A public package published with the same name as an internal one so builds fetch the attacker's version

Scope and pin internal packages.

Lesson: Securing the Software Supply Chain

Authentication, Sessions and Monitoring

19. What is credential stuffing?

  1. Filling a form automatically for accessibility
  2. Storing too many passwords
  3. Encrypting credentials twice
  4. Trying username and password pairs leaked from other sites
Show answer

Answer: Trying username and password pairs leaked from other sites

Defend with MFA, rate limits and breach checks.

Lesson: Authentication Failures

20. Why regenerate the session ID at login?

  1. To make cookies smaller
  2. To prevent session fixation, where an attacker sets a known session ID beforehand
  3. To improve caching
  4. To log the user out
Show answer

Answer: To prevent session fixation, where an attacker sets a known session ID beforehand

New privilege level, new session.

Lesson: Sessions and Tokens

21. Which should never appear in security logs?

  1. Event type
  2. Passwords and session tokens
  3. User ID
  4. Timestamp
Show answer

Answer: Passwords and session tokens

Logs must not become a source of secrets.

Lesson: Security Logging and Monitoring

Building Security Into Development

22. What does DAST test?

  1. Only passwords
  2. Source code without running it
  3. Only dependencies
  4. A running application, from the outside
Show answer

Answer: A running application, from the outside

Dynamic application security testing.

Lesson: Security Testing

23. What does "fail closed" mean?

  1. When a security check cannot complete, access is denied
  2. The application shuts down permanently
  3. Errors are hidden from logs
  4. Access is granted to avoid downtime
Show answer

Answer: When a security check cannot complete, access is denied

Safe default on failure.

Lesson: Handling Exceptional Conditions

24. Where should secure code review focus most?

  1. Variable naming only
  2. Code formatting
  3. Where untrusted input crosses trust boundaries and reaches sensitive sinks
  4. Comment spelling
Show answer

Answer: Where untrusted input crosses trust boundaries and reaches sensitive sinks

Follow the data.

Lesson: Secure Code Review

25. Which item belongs on an OWASP Top 10 release checklist?

  1. Passwords hashed with MD5
  2. Debug mode on in production for easier support
  3. Every endpoint checks object-level authorisation on the server
  4. Secrets committed for convenience
Show answer

Answer: Every endpoint checks object-level authorisation on the server

Deny by default.

Lesson: An OWASP Top 10 Checklist

← Back to the course