Web Security Senior interview questions and answers
75 questions for a Web Security (Senior) interview - with correct answers, explanations and links to the docs.
Take this quiz- 1.What does the STRIDE model help you do?
- 2.When is threat modeling most useful?
- 3.What is the core idea of zero trust architecture?
- 4.What is OWASP ASVS used for?
- 5.Why are secure defaults important in a shared internal library or framework?
- 6.A team adds a new data flow: the browser uploads files that a background worker processes. Which question is most important for the threat model?
- 7.What does "blast radius" mean in security design?
- 8.How do you roll out Trusted Types in a large existing app?
- 9.What is a script gadget?
- 10.What is mutation XSS (mXSS)?
- 11.What does the HTML Sanitizer API (
setHTML) offer compared with a JavaScript sanitizer library? - 12.What is dangling markup injection?
- 13.A policy uses a nonce, but the HTML page is cached by a CDN and served to many users. What's wrong?
- 14.Why can a CSP allowing
https://cdn.jsdelivr.netbe bypassed? - 15.What does
require-trusted-types-for 'script'actually enforce? - 16.In a design system, a
<RichText html={...} />component wrapsdangerouslySetInnerHTML. What's the most robust approach? - 17.Why can XSS through
postMessagehappen even on a site with strict CSP? - 18.What is a good way to handle CSP violation reports at scale?
- 19.Which is the main remaining risk once a strict nonce CSP and Trusted Types are in place?
- 20.Which two headers make a page cross-origin isolated?
- 21.Why were
SharedArrayBufferand high-resolution timers restricted after Spectre? - 22.What does
Cross-Origin-Opener-Policy: same-originprotect against? - 23.What are XS-Leaks?
- 24.What does a resource isolation policy based on Fetch Metadata do?
- 25.What is site isolation in browsers?
- 26.What does
Cross-Origin-Embedder-Policy: credentiallesschange compared withrequire-corp? - 27.What attributes should an iframe that shows untrusted user HTML have?
- 28.Why do security teams serve user-uploaded content from a separate domain like
usercontent.example? - 29.What is the backend-for-frontend (BFF) pattern for SPA authentication?
- 30.Tokens kept only in memory in a SPA vs
HttpOnlycookies: what's the key trade-off? - 31.What is refresh token reuse detection?
- 32.What do sender-constrained tokens (for example DPoP) protect against?
- 33.What is the JWT algorithm confusion attack (RS256 to HS256)?
- 34.How are JWT signing keys rotated without logging everyone out?
- 35.Why are passkeys (WebAuthn) resistant to phishing?
- 36.Why is SMS considered a weaker second factor?
- 37.Which signals justify step-up authentication in the middle of a session?
- 38.How should "log out everywhere" be implemented with JWT access tokens?
- 39.Why should login and password reset responses take about the same time for existing and unknown accounts?
- 40.How should a service compare a provided API key or HMAC signature with the expected value?
- 41.Which source of randomness should be used for session IDs and reset tokens in a browser or Node.js?
- 42.According to the OAuth 2.0 Security BCP (RFC 9700), who should use PKCE?
- 43.What is an OAuth mix-up attack?
- 44.How can an authorization code or token leak through the
Refererheader? - 45.What does the OIDC
nonceparameter protect against? - 46.Why should API access tokens have a specific audience (
aud)? - 47.Why does the OAuth BCP discourage the resource owner password credentials grant?
- 48.An OAuth provider allows
redirect_uri=https://app.com/callback/../open-redirect?to=evil. What combination creates a token leak? - 49.What is dependency confusion?
- 50.Why are npm
postinstallscripts a supply chain risk? - 51.What does npm package provenance give you?
- 52.What is SLSA?
- 53.A script from a CDN is included with
<script src="https://cdn.example/lib@3.2.1.js">. What does addingintegrity="sha384-..."protect against? - 54.What's the main risk of loading many third-party scripts through a tag manager?
- 55.How should automated dependency updates (Dependabot, Renovate) be handled safely?
- 56.What is typosquatting in package registries?
- 57.Which CI practice best limits the damage of a compromised dependency during builds?
- 58.Your server fetches a URL that users provide for link previews. What's the biggest risk?
- 59.Why is unsafe deserialization dangerous?
- 60.What is ReDoS?
- 61.Which rate limiting design suits a public login API best?
- 62.What should never appear in application logs?
- 63.What is the main benefit of a secrets manager over environment variables in a repo?
- 64.Why should file uploads be validated by content and not just by extension?
- 65.What is BOLA in the OWASP API Security Top 10?
- 66.Why does every Next.js Server Action need its own authorization check?
- 67.What was the core issue in the 2025 Next.js middleware vulnerability (CVE-2025-29927)?
- 68.A React Server Component fetches a user record and passes the whole object to a Client Component. What's the risk?
- 69.Why can server-side rendering reintroduce XSS that the client framework would prevent?
- 70.An app sends user input to an LLM and shows the answer as HTML. Which risk does the OWASP LLM Top 10 list first?
- 71.Where should authorization logic live in a full-stack framework app to be the most reliable?
- 72.What does a CVSS score describe?
- 73.What is
/.well-known/security.txtfor? - 74.What's the right order of actions when a production secret leaks?
- 75.How do automated scanning (SAST/DAST), pentests and bug bounties complement each other?