Interview Q&A · questions with model answers
Web Security & WAF Interview Questions
Part of the study plan for: DevOps Engineer · Cloud Engineer · Backend Engineer · Frontend Engineer · Full Stack Engineer · QA Engineer / SDET
Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.
-
Most asked What is the OWASP Top 10 and which risks does it currently highlight?
The OWASP Top 10 is a consensus list of the most critical web application security risks. The 2025 edition lists: Broken Access Control, Security Misconfiguration, Software Supply Chain Failures,…
-
Most asked What is Cross-Site Scripting (XSS) and how do you prevent it?
XSS lets attackers inject script into pages viewed by other users, stealing sessions or acting as them. Prevent it with context-aware output encoding (auto-escaping templates), sanitizing any HTML…
-
Most asked What is SQL injection and how do you prevent it?
SQL injection occurs when untrusted input is concatenated into SQL, letting attackers change the query to read or modify data. Prevent it with parameterized queries/prepared statements (or ORMs used…
-
Most asked What is CSRF and how do you defend against it?
Cross-Site Request Forgery tricks a logged-in user's browser into sending an unwanted state-changing request to your site, because browsers automatically attach cookies. Defend with SameSite…
-
Most asked What is a Web Application Firewall (WAF), and what can and can't it do?
A WAF inspects HTTP traffic (at a CDN, load balancer or reverse proxy) and blocks requests matching attack patterns (SQLi, XSS, known exploits), bad bots and abusive rates, using managed rule sets…
-
Most asked What is SSRF (Server-Side Request Forgery) and how do you prevent it?
SSRF happens when an attacker makes your server fetch a URL of their choosing, reaching internal services or cloud metadata endpoints (e.g., 169.254.169.254) to steal credentials. Prevent it by…
-
What is Content-Security-Policy and how do you roll it out?
CSP is a response header that tells browsers which sources of scripts, styles, images, frames and connections are allowed, blocking injected inline scripts and limiting XSS impact. Roll it out in…
-
What is CORS, and what are common CORS misconfigurations?
CORS is a browser mechanism that lets a server permit cross-origin JavaScript to read its responses. Misconfigurations include reflecting any Origin with Access-Control-Allow-Credentials: true,…
-
What are common security misconfigurations in web deployments?
Debug mode or stack traces in production, default credentials, open admin panels, permissive CORS, exposed cloud storage buckets, verbose error messages, unnecessary services and ports, missing…
-
What are insecure deserialization vulnerabilities?
Deserializing untrusted data with formats that can instantiate arbitrary objects (Java serialization, Python pickle, PHP unserialize, YAML unsafe loaders) can trigger code execution through gadget…
-
What is clickjacking and how do you prevent it?
Clickjacking embeds your site in an invisible iframe on an attacker's page, tricking users into clicking buttons they can't see. Prevent it with Content-Security-Policy: frame-ancestors 'none' (or…
-
What are best practices for TLS/HTTPS?
Use HTTPS everywhere with TLS 1.2+ (prefer 1.3), modern cipher suites, automated certificate renewal (ACME/Let's Encrypt or managed certs), HSTS, redirect HTTP to HTTPS, and encrypt internal traffic…
-
What is threat modeling and how do you run one?
Threat modeling systematically identifies what you're building, what can go wrong, what you'll do about it, and whether you did a good job, using a data-flow diagram of components and trust…
-
What is an open redirect vulnerability?
An open redirect sends users to an attacker-controlled URL via your domain (e.g., ?next=https://evil.com), lending credibility to phishing and enabling OAuth token theft in some flows. Validate…
-
What is command injection and how do you prevent it?
Command injection happens when user input reaches a system shell, letting attackers run arbitrary commands. Avoid shells entirely: call programs with argument arrays (subprocess.run([...]),…
-
What is path traversal and how do you prevent it?
Path traversal uses sequences like ../ (or encoded variants) in file names to access files outside the intended directory. Prevent it by mapping IDs to files instead of accepting paths, normalizing…
-
What are software and data integrity failures?
They're failures to verify that code, updates, pipelines or data haven't been tampered with: unsigned updates, CI/CD pipelines that run untrusted code, dependencies from untrusted sources, and…
-
What are common cryptographic failures?
Using weak or outdated algorithms (MD5/SHA-1 for security, DES, ECB mode), hard-coded or reused keys, missing encryption for sensitive data at rest or in transit, predictable random numbers, and…
-
What new security risks do LLM-powered features introduce?
Prompt injection (direct or via retrieved documents) that overrides instructions, insecure handling of model output (rendering HTML/SQL/commands generated by the model), sensitive data leakage…
-
What does the OWASP API Security Top 10 add beyond the web Top 10?
It focuses on API-specific risks: Broken Object Level Authorization (IDOR), Broken Authentication, Broken Object Property Level Authorization (mass assignment, excessive data exposure), Unrestricted…
-
What is XXE (XML External Entity) injection?
XXE exploits XML parsers that process external entity declarations, letting attackers read local files, perform SSRF or cause denial of service (billion laughs). Disable DTDs and external entities…
-
What is subdomain takeover?
A subdomain takeover occurs when a DNS record (often a CNAME) points to a deprovisioned cloud resource (an S3 bucket, Heroku app, Azure site) that an attacker can claim, serving content on your…