OWASP interview questions and answers
OWASP interview questions use the OWASP Top 10 as a shared vocabulary: interviewers name a category such as broken access control or injection and ask you to explain the risk, show vulnerable code and write the fix. Developer rounds focus on defenses in code review; AppSec rounds add ASVS, the API Security Top 10, threat modeling and how to roll out security testing without stalling delivery. Know the categories, but expect to be scored on fixes and judgment rather than on reciting the list.
By Evin JohnPublished 8 min read
How OWASP comes up in interviews
OWASP, the Open Worldwide Application Security Project, is a nonprofit community that publishes free guides, standards and tools for web and API security. Hiring teams lean on its Top 10 because almost every developer has heard of it, which makes it an easy starting point that quickly shows who understands the fixes. Backend and full-stack developers get a few OWASP questions in a code review round. AppSec engineers, security-minded QA engineers and penetration testers get a full round built on it.
- Vocabulary checkName the Top 10 categories you know, say which ones matter most for this company's stack, and explain the difference between authentication and authorization.
- Code reviewA short handler or query with a flaw. You name the category, the impact and the fix, then say how a test would catch it next time.
- Design discussionA new feature such as file uploads, a webhook or a password reset. You walk through threats and controls before any code exists.
- Program questions (AppSec roles)How you would choose and tune scanners, triage findings, train developers and measure whether things improved.
OWASP fundamentals questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What is the OWASP Top 10, and what is it not? | Framing | An awareness document ranking broad categories of web application risk, built from contributed data and a community survey. It is not a complete standard or a checklist for passing an audit. |
| How is ASVS different from the Top 10? | Standards | The Application Security Verification Standard lists testable requirements at increasing levels of rigor. Teams use it to set requirements and test against them; the Top 10 is for awareness. |
| Authentication versus authorization? | Basics | Authentication proves who you are. Authorization decides what you may do. Most serious breaches in the Top 10's first category pass the first check and fail the second. |
| Why does broken access control rank so high? | Prevalence | Every endpoint needs an ownership or role check, frameworks rarely add them automatically, and scanners cannot know the business rule. One missing check exposes data. |
| Input validation or output encoding: which one prevents XSS? | Defense placement | Output encoding for the context where data lands is the main defense. Validation narrows what comes in and helps, but data that is valid in one context can still be dangerous in another. |
| What does "vulnerable and outdated components" cover? | Dependencies | Libraries, frameworks and runtimes with known flaws, including transitive dependencies. Software composition analysis and an inventory such as an SBOM tell you what you run. |
| Give three examples of security misconfiguration. | Breadth | Default credentials left on, verbose error pages showing stack traces, a storage bucket readable by anyone, missing security headers, or debug endpoints enabled in production. |
| What is a CWE, and how does it relate to a CVE? | Taxonomy | A CWE names a type of weakness, such as improper neutralization of input in SQL. A CVE identifies one specific vulnerability in one product. The Top 10 categories map to groups of CWEs. |
| What is least privilege, in one example? | Principle | The application's database account can read and write its own tables but cannot drop them or read other schemas, so an injection bug has a smaller blast radius. |
| What should a login failure message say? | Enumeration | The same generic message for a wrong user and a wrong password, with similar response times, so attackers cannot learn which accounts exist. |
The Top 10 categories, question by question
Many interviewers still use the 2021 edition's names, shown below. OWASP has since published a newer edition that reorders the list and renames or merges some categories, for example giving software supply chain failures their own place and folding SSRF into access control. Read the current list on the OWASP site before your interview and ask which edition the team follows.
| Category | Typical interview question | What a strong answer shows |
|---|---|---|
| A01 Broken Access Control | A user changes the order ID in the URL and sees another customer's order. Fix it. | Load the record scoped to the current user or check ownership on the server for every request, deny by default, and add a test with two accounts. |
| A02 Cryptographic Failures | Where does sensitive data need protecting in this app? | Classify data first, use TLS everywhere, encrypt sensitive fields at rest with managed keys, and store passwords with a slow password hash, never a fast digest. |
| A03 Injection | Why are parameterized queries better than escaping? | Parameters keep data separate from the query's structure, so input can never change the command. Escaping depends on getting every context and character right. |
| A04 Insecure Design | What can code review not fix? | Missing controls in the design itself, such as a reset flow with no rate limit or a business rule that trusts the client. Threat modeling before building is the remedy. |
| A05 Security Misconfiguration | How do you keep configuration safe across many services? | Hardened templates, infrastructure as code with review, automated checks for headers, open storage and debug flags, and the same settings in every environment. |
| A06 Vulnerable and Outdated Components | A critical CVE drops for a library you use. What now? | Find every service that includes it, directly or transitively, judge whether the vulnerable path is reachable, patch or mitigate by priority, and track to closure. |
| A07 Identification and Authentication Failures | What makes a login system weak? | Credential stuffing with no rate limiting, no multi-factor option, weak recovery flows, session IDs that do not rotate at login, and long-lived tokens that cannot be revoked. |
| A08 Software and Data Integrity Failures | Why is unsigned auto-update risky? | Whoever controls the update channel or a build step controls the code you run. Sign artifacts, verify signatures, pin dependencies and protect the CI pipeline. |
| A09 Security Logging and Monitoring Failures | What should you log for security, and what never? | Log logins, access denials, privilege changes and admin actions with who, what and when, and alert on patterns. Never log passwords, full tokens or card numbers. |
| A10 Server-Side Request Forgery | Your app fetches a URL the user provides. What can go wrong? | The server can be steered to internal services or a cloud metadata endpoint. Allowlist destinations, block internal ranges at resolution time, disable redirects and isolate the fetcher on the network. |
Intermediate: write the fix
Developer interviews usually move from naming a category to writing defensive code. The snippet below covers four fixes that come up often. Each one is a small function you can explain line by line.
import path from "node:path";
import net from "node:net";
// Injection / XSS: encode for the HTML body context before inserting text
const escapeHtml = (s) =>
String(s).replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]);
console.log(escapeHtml(`<img src=x onerror="alert(1)">`));
// <img src=x onerror="alert(1)">
// Broken access control: path traversal guard for a file download endpoint
const BASE = path.resolve("/srv/app/uploads");
function safeJoin(userPath) {
const full = path.resolve(BASE, userPath);
if (full !== BASE && !full.startsWith(BASE + path.sep)) throw new Error("outside base dir");
return full;
}
console.log(path.basename(safeJoin("reports/q3.pdf"))); // q3.pdf
try { safeJoin("../../etc/passwd"); } catch (e) { console.log(e.message); } // outside base dir
// SSRF: parse the URL, allow only https on known hosts, reject IP literals
const ALLOWED_HOSTS = new Set(["api.partner.example"]);
function checkOutbound(raw) {
const u = new URL(raw);
if (u.protocol !== "https:") return "blocked: scheme";
if (net.isIP(u.hostname.replace(/^\[|\]$/g, ""))) return "blocked: IP literal";
if (!ALLOWED_HOSTS.has(u.hostname)) return "blocked: host";
return "allowed";
}
for (const raw of [
"https://api.partner.example/v1/rates",
"http://169.254.169.254/latest/meta-data/",
"https://api.partner.example@evil.example/",
"https://[::1]/admin",
]) console.log(checkOutbound(raw));
// allowed / blocked: scheme / blocked: host / blocked: IP literal
// API mass assignment: copy only the fields a user may change
const EDITABLE = ["displayName", "timezone"];
const body = { displayName: "Ana", role: "admin", timezone: "UTC" };
const update = Object.fromEntries(EDITABLE.filter((k) => k in body).map((k) => [k, body[k]]));
console.log(update); // { displayName: 'Ana', timezone: 'UTC' }- Why does the URL check parse with `new URL` instead of using a regex or `startsWith`? Strings like
https://api.partner.example@evil.example/put the trusted name in the user-info part while the real host is elsewhere. Parsing gives the host the client will actually contact. - Is a hostname allowlist enough against SSRF? Not on its own. An allowed name could later resolve to an internal address, and redirects can bounce the request elsewhere. Check the resolved IP when connecting, turn off redirects and run the fetcher with no route to internal networks.
- How does CSRF work, and what stops it now? A malicious site makes the victim's browser send a state-changing request with their cookies. Anti-CSRF tokens,
SameSitecookies and requiring a custom header for APIs all break it; GET requests should never change state. - What does a Content Security Policy add if you already encode output? A second layer: it limits where scripts may load from and can block inline scripts, so one missed encoding is less likely to become a working attack.
- When is CORS a security control and when is it not? It only tells browsers which other origins may read responses. It does not stop requests from scripts, servers or tools, so it never replaces authentication or authorization.
- What is insecure deserialization? Turning untrusted bytes back into objects with a format that can instantiate arbitrary types, which in some languages leads to code execution. Prefer data-only formats such as JSON with a schema.
- How should a password reset flow work? Single-use, short-lived random tokens sent to the verified address, the same response whether or not the account exists, rate limits, and invalidating existing sessions after the change.
- What is XXE, and how do you turn it off? An XML parser that resolves external entities can read local files or make network calls. Disable DTDs and external entity resolution in the parser settings.
- What should error responses reveal? A generic message and a correlation ID for support. Stack traces, SQL errors and framework versions belong in server logs only.
Senior and scenario questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| Threat model a feature that lets users upload profile pictures. | Design thinking | Data flow first, then threats per step: oversized files, wrong types, image parser flaws, stored XSS through SVG, path issues, public URLs that leak. Controls: size limits, type checks on content, re-encoding, separate storage domain, scanning. |
| Which items from the API Security Top 10 differ most from the web list? | API depth | Object-level and property-level authorization, unrestricted resource consumption and unprotected business flows. APIs expose IDs and fields directly, so authorization has to be checked per object and per field. |
| A scanner reports 400 findings. How do you triage? | Prioritization | Remove duplicates and false positives, rank by reachability, exposure and data sensitivity rather than raw severity score, fix the top patterns at their root, and feed tuning back into the tool. |
| How would you add SAST, DAST and dependency scanning to CI? | Delivery | Fast checks on each pull request with only high-confidence rules blocking, heavier scans nightly, a clear owner for each finding and a way to suppress with a reason. Track time to fix, not just counts. |
| Which ASVS level would you pick for a payments app versus an internal tool? | Risk fit | Roughly, Level 1 is a baseline, Level 2 suits most apps handling sensitive data, and Level 3 is for the most critical systems. A payments app usually targets at least Level 2. Level definitions have shifted between ASVS versions, so name the one you used. |
| How do you make developers care about the Top 10? | Culture | Short, stack-specific training with real examples from your own code, secure defaults in shared libraries, security champions in teams and fast, friendly review rather than gatekeeping. |
| What does OWASP offer for LLM features? | Current awareness | A separate Top 10 for LLM applications covers risks such as prompt injection, sensitive data disclosure and excessive agency. Name it, and say that classic access control still applies to whatever tools the model can call. |
Fictional example
- Interviewer
- Here is a handler:
GET /api/invoices/:idlooks up the invoice by ID and returns it as JSON if the user is logged in. Thoughts? - Candidate
- Logged in is authentication, but nothing checks that this invoice belongs to the caller, so any user can read any invoice by changing the number. That is broken object-level authorization, the first item on both the web and API lists. I would query by ID and the caller's account together, return 404 rather than 403 so IDs are not confirmed, and add a test where user B requests user A's invoice.
- Interviewer
- The IDs are UUIDs, so nobody can guess them. Still a problem?
- Candidate
- Yes. IDs leak through shared links, logs, emails and browser history, and unguessable is not the same as authorized. Random IDs are a nice extra layer, but the ownership check is the control. I would also check the list endpoint and any export feature, since the same bug often appears in more than one place.
A one-week OWASP study plan
- Day 1: read the current Top 10 and write one sentence of risk and one of fix for each category in your own words.
- Day 2: access control. Write an ownership check, a role check and the two-account test for each in your main language.
- Day 3: injection and XSS. Rewrite a concatenated query with parameters and practice output encoding for HTML, attributes and URLs.
- Day 4: SSRF, path traversal and mass assignment fixes, as in the snippet above, plus why each naive version fails.
- Day 5: skim ASVS and the API Security Top 10, and the OWASP Cheat Sheet Series pages for your framework.
- Day 6: practice on an intentionally vulnerable app such as OWASP Juice Shop, on your own machine only, then write up two findings with fixes.
- Day 7: a mock round: one code review, one threat model and one triage question, each explained in under five minutes.
Cryptographic failures get their own page: cryptography interview questions. For the full roles, see security engineer interview questions and penetration tester interview questions, and for the server code these fixes live in, backend developer interview questions.
Security code review rewards a calm, ordered explanation: category, impact, fix, test. Natively is an AI interview assistant for Mac and Windows that can transcribe a mock review on your computer, so you can check whether you named the impact before jumping to the fix. During practice it can read a vulnerable snippet from a screenshot and suggest the defensive version to compare with yours. With Pro or the free trial it can use the résumé and job description you add, and it keeps the transcript and notes for review.
Questions people ask
What OWASP questions are asked in interviews?
Interviewers ask what the OWASP Top 10 is, how a category such as broken access control or injection shows up in code, how to fix XSS, SSRF and CSRF, how ASVS differs from the Top 10, and how you would triage scanner findings.
Do I need to memorize the OWASP Top 10 for an interview?
Know the categories and their order roughly, but expect more weight on explaining the risk and writing the fix. Check which edition the team uses, since names and order changed between editions.
What is the most important OWASP category for developers?
Broken access control is the one interviewers return to most, because every endpoint needs a server-side ownership or role check and scanners rarely catch a missing one.
How do I prepare for an OWASP code review interview?
Practice reading short handlers and naming the flaw, its impact, the fix and a test. Work through injection, XSS, access control, SSRF and mass assignment in your main language.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
