PrepStack › Frontend › Web Security

Web Security interview cheat sheet

Origins, CORS, XSS, CSP, CSRF, cookies, tokens, headers and supply chain

Frontend security interviews check that you understand the browser's security model (origins, cookies, CORS) and the classic attacks against it: XSS, CSRF, clickjacking, open redirects and supply-chain compromise. Expect "how would you store tokens?", "why is my CORS request failing?" and "design a CSP for this app". Read the 15-minute revision first, then use Quiz mode and explain each defence out loud, including what it does not protect against.

15-minute revision

  1. An origin is scheme + host + port. A site is scheme + registrable domain (eTLD+1). a.example.com and b.example.com are cross-origin but same-site.
  2. The same-origin policy lets a page embed and send to other origins, but blocks reading their responses and DOM. CORS is the opt-in to relax reads.
  3. CORS is enforced by the browser, configured by the server. Simple requests (GET/HEAD/POST + safelisted headers and content types) go straight out; others need an OPTIONS preflight.
  4. With credentials, the server must echo the exact origin (never *), send Access-Control-Allow-Credentials: true and add Vary: Origin.
  5. XSS = attacker script runs in your origin. Types: stored, reflected, DOM-based. Fix: context-aware output encoding, sanitizing HTML (DOMPurify), safe sinks (textContent), CSP and Trusted Types.
  6. React escapes text by default. Danger zones: dangerouslySetInnerHTML, href={userUrl} with javascript:, refs plus innerHTML, and server-rendered state injected into <script>.
  7. A strict CSP uses nonces or hashes plus 'strict-dynamic', object-src 'none' and base-uri 'none'. Host allowlists are easy to bypass.
  8. CSRF = the browser sends your cookies on a forged cross-site request. Defences: SameSite cookies, synchronizer or signed double-submit tokens, checking Origin/Sec-Fetch-Site.
  9. Cookie flags: HttpOnly (no JS access), Secure (HTTPS only), SameSite=Strict|Lax|None (None needs Secure), __Host- prefix (Secure, Path=/, no Domain).
  10. Token storage: localStorage is readable by any XSS; HttpOnly cookies cannot be read but need CSRF defences; memory is lost on reload. The BFF pattern keeps tokens off the browser entirely.
  11. A JWT is signed, not encrypted. The frontend may decode it for UI only; the server must verify signature, exp, aud and iss.
  12. Clickjacking: send Content-Security-Policy: frame-ancestors 'none' (or 'self') and X-Frame-Options: DENY for old browsers.
  13. HSTS forces HTTPS for future visits; preload fixes the first visit. Mixed content: active content is blocked, passive content is auto-upgraded or blocked.
  14. SRI (integrity="sha384-..." + crossorigin) blocks a CDN file that changed. Lockfiles + npm ci + npm audit + review of install scripts reduce supply-chain risk.
  15. Open redirects: allow only relative paths or an allowlist of origins. Prototype pollution: block __proto__/constructor/prototype keys, use Object.create(null) or Map.
  16. OWASP Top 10:2025 #1 is still Broken Access Control; Security Misconfiguration rose to #2 and Software Supply Chain Failures is new at #3. XSS sits under Injection.

Browser security model

Origins & the same-origin policy

Two URLs share an origin only if scheme, host and port all match, and only same-origin code may read another page's data.

  • Origin = scheme://host:port. Path, query and hash do not matter. Default ports are implied (https = 443), so https://a.com and https://a.com:443 are the same origin.
  • The same-origin policy (SOP) blocks a script from reading cross-origin responses, cookies of other origins, localStorage, and the DOM of cross-origin frames.
  • SOP does not stop writes and embeds: forms can POST anywhere, and <img>, <script>, <link>, <iframe> can load cross-origin resources. That gap is why CSRF and clickjacking exist.
  • Site (used by SameSite cookies) = scheme + registrable domain (eTLD+1, using the Public Suffix List). app.example.com and api.example.com are same-site, cross-origin.
  • Safe cross-origin channels: CORS for HTTP reads and postMessage for frames and popups. Always check event.origin in a message listener.
  • Opaque origins (data: URLs, sandboxed iframes, file: in many browsers) serialize as "null". Never allowlist the string null.

Interview questions

  • What is an origin and what is the same-origin policy?
  • Difference between same-origin and same-site?
  • If SOP exists, why can a page still load images and scripts from a CDN?
  • How do two windows on different origins talk safely?

CORS: simple requests, preflight & credentials

CORS lets a server tell the browser which other origins may read its responses; non-simple requests are checked first with an OPTIONS preflight.

  • The browser adds an Origin header. If the response has a matching Access-Control-Allow-Origin, the page can read it; otherwise the fetch rejects with a generic network error.
  • Simple request: method GET, HEAD or POST; only safelisted headers (Accept, Accept-Language, Content-Language, Content-Type); Content-Type only text/plain, multipart/form-data or application/x-www-form-urlencoded. It is sent directly.
  • Anything else (PUT/DELETE/PATCH, Content-Type: application/json, Authorization, custom headers) triggers a preflight: OPTIONS with Access-Control-Request-Method and Access-Control-Request-Headers.
  • The server answers the preflight with Access-Control-Allow-Methods, -Allow-Headers and optionally -Max-Age to cache it. Only then is the real request sent.
  • Credentials (fetch(url, { credentials: 'include' })): the server must return the exact origin (not *) plus Access-Control-Allow-Credentials: true. Wildcards in Allow-Headers/Methods are also not honoured then.
  • JS can read only safelisted response headers unless the server lists others in Access-Control-Expose-Headers.

Interview questions

  • What is CORS and who enforces it?
  • What triggers a preflight request?
  • Why can't I use Access-Control-Allow-Origin: * with cookies?
  • Scenario: the API works in Postman but fails in the browser with a CORS error. How do you debug it?
  • Senior follow-up: what are the risks of reflecting the Origin header?

XSS & Content Security Policy

XSS: stored, reflected & DOM-based

Cross-site scripting means attacker-controlled data ends up executed as script in your origin, with full access to the page and the user's session.

  • Stored XSS: payload is saved on the server (comment, profile name) and served to every viewer. Highest impact.
  • Reflected XSS: payload comes in the request (query string, form) and the server echoes it into the response. The victim must click a crafted link.
  • DOM-based XSS: the bug is entirely in client JS. A source (location.hash, postMessage data, document.referrer) flows into a sink (innerHTML, eval, setTimeout(string), location = ...) without the server seeing it.
  • Impact: the script runs as your origin. It can call your APIs with the user's cookies, read the DOM and non-HttpOnly storage, log keystrokes, and change what the user sees.
  • Root fix: treat all data as data. Encode on output for the right context, sanitize when you must accept HTML, and use safe sinks (textContent, setAttribute for non-URL attributes).
  • Defence in depth: framework auto-escaping, CSP, Trusted Types, HttpOnly cookies (limits theft, not the attack).

Interview questions

  • What is XSS and what are its types?
  • Why is XSS considered so severe if cookies are HttpOnly?
  • How would you find DOM XSS in a codebase?

Output encoding & sanitizing HTML

Escape data for the exact context it is placed in, and when users must supply HTML, run it through an allowlist sanitizer like DOMPurify.

  • HTML body context: escape & < > " ' into entities. This is what template engines and JSX do automatically.
  • Attribute context: always quote attributes and escape quotes. Unquoted attributes can be broken by a space.
  • URL context (href, src): escaping is not enough; you must also allow only http:/https: (and maybe mailto:). Use encodeURIComponent for values inside a URL.
  • JS and CSS contexts are hard to escape correctly. Avoid putting user data inside <script> or style; pass it through data-* attributes or a JSON <script type="application/json"> block.
  • Sanitizing is different from escaping: it keeps safe HTML (<b>, <a href>) and removes the rest. Use a maintained library such as DOMPurify; never write your own regex-based sanitizer.
  • The HTML Sanitizer API (el.setHTML(str)) exists but is not yet Baseline. Check browser support before relying on it.

Interview questions

  • What is the difference between escaping and sanitizing?
  • Why is "context-aware" encoding important?
  • Can you just strip <script> tags to prevent XSS?

XSS in React & SPA frameworks

React escapes text by default, so XSS in React apps comes from the escape hatches: raw HTML, unsafe URLs, direct DOM access and SSR state.

  • JSX {value} is rendered as a text node, so <script> in data shows up as text. Angular and Vue interpolation also escape.
  • dangerouslySetInnerHTML={{ __html: s }} skips escaping. Only use it with sanitized HTML (DOMPurify) or fully trusted static content.
  • <a href={user.website}> can run javascript:alert(1). React only logs a warning for javascript: URLs; validate the scheme yourself.
  • Refs give raw DOM nodes: ref.current.innerHTML = s is a normal DOM-XSS sink. Same for third-party libraries that render HTML (markdown, charts, rich-text editors).
  • SSR: window.__STATE__ = ${JSON.stringify(state)} inside <script> breaks if state contains </script>. Escape < or use a library like serialize-javascript.
  • Vue v-html and Angular [innerHTML] are the equivalents. Angular sanitizes [innerHTML] by default; bypassSecurityTrustHtml turns that off.

Interview questions

  • Is a React app immune to XSS?
  • When is dangerouslySetInnerHTML acceptable?
  • How do you safely pass server data into the page during SSR?

Content Security Policy basics

CSP is a response header that tells the browser which sources of script, style, frames and connections are allowed, so injected code fails to run.

  • Sent as Content-Security-Policy header (preferred) or <meta http-equiv>. frame-ancestors, report-uri/report-to and sandbox do not work in the meta tag.
  • default-src is the fallback for fetch directives. Override with script-src, style-src, img-src, connect-src (fetch/XHR/WebSocket), font-src, frame-src, media-src, worker-src.
  • Document and navigation directives: base-uri (blocks <base> hijacking), form-action, frame-ancestors (who may frame you), upgrade-insecure-requests.
  • Inline scripts, inline event handlers (onclick=) and eval are blocked unless you allow them. 'unsafe-inline' and 'unsafe-eval' largely defeat CSP's XSS protection.
  • Roll out with Content-Security-Policy-Report-Only plus report-to to collect violations without breaking the site, then enforce.
  • CSP is defence in depth. It reduces the impact of an XSS bug; it does not replace output encoding.

Interview questions

  • What is CSP and how does it help against XSS?
  • How would you roll out CSP on an existing large app?
  • Difference between frame-src and frame-ancestors?

Strict CSP: nonces, hashes & 'strict-dynamic'

A strict CSP trusts scripts by nonce or hash instead of by host, and 'strict-dynamic' passes that trust to scripts those trusted scripts load.

  • Nonce: the server generates a fresh random value (at least 128 bits, base64) per response, puts it in the header ('nonce-abc') and on each <script nonce="abc">. Injected scripts don't know it.
  • Hash: 'sha256-<base64>' of the exact inline script text. Good for static pages and SPA shells that can't generate nonces. Any whitespace change breaks the hash.
  • 'strict-dynamic': scripts added by a trusted script via document.createElement('script') are allowed. Host allowlists, 'self' and 'unsafe-inline' are ignored in supporting browsers.
  • Recommended policy shape: script-src 'nonce-R' 'strict-dynamic' https: 'unsafe-inline'; object-src 'none'; base-uri 'none'. The https: and 'unsafe-inline' are fallbacks for very old browsers only; modern ones ignore them.
  • When a nonce or hash is present, 'unsafe-inline' is ignored, so adding it does not weaken modern browsers.
  • 'strict-dynamic' does not trust parser-inserted scripts such as those added with document.write or innerHTML.

Interview questions

  • Nonce vs hash in CSP: when do you use each?
  • What does 'strict-dynamic' do?
  • Why are host-allowlist CSPs considered weak?

Trusted Types

Trusted Types make DOM sinks like innerHTML reject plain strings, so every value must pass through a reviewed policy first.

  • Enable with CSP: require-trusted-types-for 'script'. After that, el.innerHTML = 'string' throws a TypeError.
  • You create policies with trustedTypes.createPolicy(name, { createHTML, createScript, createScriptURL }). Sinks accept only TrustedHTML, TrustedScript or TrustedScriptURL objects.
  • Restrict which policy names may exist with trusted-types myPolicy dompurify. That turns DOM-XSS review into reviewing a few policy functions.
  • A policy named default is called automatically for any raw string sent to a sink. Useful for migration, but it weakens the guarantee.
  • Three sink groups: HTML (innerHTML, document.write), script (eval, script.text), script URL (script.src, worker URLs).
  • Support: Chromium had it for years; MDN marks the API Baseline 2026 (newly available across major browsers). Use the trusted-types polyfill or feature detection for older browsers.

Interview questions

  • What problem do Trusted Types solve?
  • How do Trusted Types relate to CSP?
  • What is the risk of a default policy?

Cookies, CSRF & auth tokens

CSRF: attacks & defences

CSRF tricks a logged-in browser into sending a state-changing request with its cookies; stop it with SameSite cookies plus a token or origin check that an attacker can't forge.

  • Needs three things: cookie-based auth (sent automatically), a state-changing endpoint, and no unpredictable parameter. A hidden auto-submitting form on evil.com is enough.
  • SameSite=Lax/Strict blocks most cross-site POSTs, but not same-site attackers (subdomains) and not GET endpoints that change state.
  • Synchronizer token: server stores a random token in the session, renders it into forms/meta tag, and checks it on every unsafe request.
  • Double-submit cookie: token in a cookie and in a header/body; server checks they match. Use the signed variant (HMAC bound to the session) so a subdomain that can write cookies can't forge it.
  • Header checks: verify Origin (or Sec-Fetch-Site: same-origin) on unsafe methods. Requiring a custom header (X-CSRF-Token) also forces a CORS preflight for cross-origin callers.
  • Pure bearer-token APIs (token in Authorization header, not cookies) are not CSRF-prone, because the browser does not attach the token automatically.

Interview questions

  • What is CSRF and why does it work?
  • Is SameSite enough to stop CSRF?
  • Difference between CSRF and XSS?
  • Why should the double-submit token be signed?

Token storage & JWT on the frontend

Prefer HttpOnly cookies or a backend-for-frontend; if a SPA must hold tokens, keep short-lived access tokens in memory, and never trust a JWT you only decoded.

  • localStorage/sessionStorage: simple and survive reload (session storage per tab), but any XSS can read and exfiltrate the token to use from anywhere.
  • HttpOnly cookie: JS cannot read it, sent automatically, so you need CSRF defences (SameSite + token). The attacker must act through the victim's open page.
  • In-memory (a JS variable / closure): not persisted, so not readable by later scripts or extensions reading storage. Lost on reload, so refresh silently using an HttpOnly refresh-token cookie.
  • A JWT is base64url(header).base64url(payload).signature. It is signed, not encrypted. Anyone can read the claims; never put secrets or PII in it.
  • Frontend may decode a JWT to show the user's name or schedule a refresh before exp. Only the server verifies the signature, exp, aud, iss, and rejects alg: none.
  • Use short-lived access tokens (minutes) and refresh-token rotation with reuse detection. Revoke by rotating; JWTs can't be "logged out" otherwise until they expire.

Interview questions

  • Where should a SPA store its access token?
  • localStorage vs cookies for tokens: trade-offs?
  • Can the frontend verify a JWT?
  • How do you handle JWT logout and revocation?

OAuth/OIDC in SPAs: PKCE & the BFF pattern

SPAs should use the authorization code flow with PKCE (never the implicit flow), and the most secure design is a backend-for-frontend that keeps tokens off the browser.

  • The implicit flow (token in the URL fragment) is deprecated by the OAuth 2.0 Security BCP (RFC 9700) and dropped in OAuth 2.1 drafts. Tokens leaked via history, referrers and extensions.
  • Authorization code + PKCE: the app creates a random code_verifier (43–128 chars), sends code_challenge = BASE64URL(SHA256(verifier)) with code_challenge_method=S256, then proves possession by sending the verifier when exchanging the code.
  • PKCE stops authorization code interception: a stolen code is useless without the verifier, which never left the app.
  • Also send state (ties the response to this browser, CSRF protection) and, for OIDC, nonce (binds the ID token to the request). Register exact redirect URIs.
  • BFF (backend-for-frontend): a same-site backend is the confidential OAuth client. It does the code exchange, stores tokens server-side, and gives the SPA an HttpOnly session cookie. API calls go through the BFF.
  • The IETF "OAuth 2.0 for Browser-Based Applications" draft ranks BFF as the most secure option, then a token-mediating backend, then a pure browser client.

Interview questions

  • Why is the implicit flow no longer recommended for SPAs?
  • Explain PKCE.
  • What is the BFF pattern and why use it?
  • state vs nonce vs PKCE: what does each protect?

Transport, framing & headers

Clickjacking: frame-ancestors & X-Frame-Options

Clickjacking hides your page in a transparent iframe so users click buttons they can't see; forbid framing with CSP frame-ancestors.

  • The attacker loads your page in an invisible <iframe> over a decoy ("Click to win"). The user's click lands on your real "Delete account" or "Allow" button, with their cookies.
  • CSP frame-ancestors is the modern control: 'none' (never frame), 'self', or a list of origins. It overrides X-Frame-Options in browsers that support both.
  • X-Frame-Options: DENY or SAMEORIGIN. ALLOW-FROM is obsolete and ignored by modern browsers. Send it too for old browsers.
  • JavaScript frame-busting (if (top !== self) top.location = self.location) is unreliable; the attacker can use sandbox on the iframe to block it.
  • SameSite=Lax/Strict cookies help too: a cross-site iframe does not get them, so the framed page appears logged out.
  • Variants: cursor-jacking, drag-and-drop, and double-click jacking. Sensitive actions can add confirmation steps.

Interview questions

  • What is clickjacking and how do you prevent it?
  • X-Frame-Options vs frame-ancestors?
  • Why not just use JavaScript frame-busting?

HTTPS, HSTS & mixed content

Serve everything over HTTPS, use HSTS so browsers never try HTTP again, and remove mixed content.

  • TLS gives confidentiality, integrity and server authentication (certificate chain to a trusted CA). Without it, anyone on the network can read or modify pages and cookies.
  • HSTS: Strict-Transport-Security: max-age=31536000; includeSubDomains; preload. After seeing it over HTTPS, the browser upgrades every http:// request to HTTPS and blocks click-through on certificate errors.
  • HSTS is ignored if sent over plain HTTP. The very first visit is still exposed (SSL stripping), which the preload list fixes: browsers ship a built-in list of HSTS domains.
  • Preload requirements (hstspreload.org): valid cert, redirect HTTP→HTTPS, max-age of at least one year, includeSubDomains and preload. Removal is slow, so be sure all subdomains support HTTPS.
  • Mixed content: an HTTPS page loading HTTP subresources. Active content (scripts, iframes, fetch, CSS) is blocked. Passive content (images, audio, video) is auto-upgraded to HTTPS by modern browsers and blocked if that fails.
  • upgrade-insecure-requests (CSP) rewrites a site's own http:// URLs to HTTPS; useful when migrating legacy content.

Interview questions

  • What is HSTS and what attack does it stop?
  • What is HSTS preloading?
  • What is mixed content and how do browsers handle it?

Security headers checklist

A handful of response headers turn on browser protections; know what each does and which legacy ones to drop.

  • Core set for HTML responses: CSP, HSTS, X-Content-Type-Options: nosniff, Referrer-Policy, frame-ancestors/X-Frame-Options, Permissions-Policy.
  • Cross-origin isolation: Cross-Origin-Opener-Policy: same-origin puts the page in its own browsing context group (no window.opener access from popups). With Cross-Origin-Embedder-Policy: require-corp you get crossOriginIsolated and SharedArrayBuffer.
  • Cross-Origin-Resource-Policy: same-origin (CORP) stops other sites from embedding your resources, which defends against Spectre-style side channels.
  • Fetch metadata request headers (Sec-Fetch-Site, -Mode, -Dest) let the server reject unexpected cross-site requests.
  • Legacy: X-XSS-Protection is deprecated; modern browsers removed the filter. Omit it or set 0. Remove X-Powered-By and detailed Server headers.
  • Use Cache-Control: no-store on pages with sensitive personal data so shared caches and back/forward cache don't keep them.

Interview questions

  • Which security headers would you set on a new web app?
  • What does X-Content-Type-Options: nosniff do?
  • What are COOP and COEP for?
  • Is X-XSS-Protection still useful?

Supply chain & JavaScript-specific bugs

SRI, third-party scripts & npm supply chain

Every third-party script runs with your origin's full power, so pin it with SRI or self-host it, and control your npm dependencies with lockfiles and audits.

  • Subresource Integrity: <script src=... integrity="sha384-..." crossorigin="anonymous">. If the downloaded file's hash differs, the browser refuses to run it. Works for scripts and stylesheets.
  • SRI needs a fixed file version. It cannot protect "evergreen" scripts that change (many analytics/tag-manager loaders); for those, limit with CSP or isolate in a sandboxed iframe.
  • Real incidents: the event-stream npm package was backdoored (2018), and the polyfill.io CDN domain changed owners and served malicious code (2024). Both bypassed source review.
  • Lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock) pin exact versions and integrity hashes. In CI use npm ci, which installs exactly the lockfile and fails if it disagrees with package.json.
  • npm audit reports known vulnerabilities; npm audit fix upgrades within semver ranges. npm audit signatures checks registry signatures and provenance attestations.
  • Reduce risk: fewer dependencies, Dependabot/Renovate with review, --ignore-scripts for install scripts, watch for typosquatting and dependency confusion (scope private packages, configure the registry).

Interview questions

  • What is Subresource Integrity?
  • How do you secure third-party scripts like analytics or chat widgets?
  • What is the purpose of a lockfile and npm ci?
  • Scenario: a popular dependency is reported compromised. What do you do?

Open redirects

An open redirect lets attackers use your trusted domain to bounce users to a phishing site or leak OAuth codes; allow only relative paths or allowlisted origins.

  • Pattern: https://app.example.com/login?next=https://evil.io. The link looks trustworthy, but after login the user lands on the attacker's site.
  • Worse in OAuth: if a redirect URI or post-login redirect can be pointed elsewhere, authorization codes or tokens can leak to the attacker.
  • Naive checks fail: next.startsWith('/') allows //evil.io (protocol-relative) and /\evil.io (browsers treat \ as /). includes('example.com') allows example.com.evil.io.
  • Correct approach: parse with new URL(next, ownOrigin), require the resulting origin to equal yours (or be in an allowlist), and redirect using the parsed path.
  • Even better: don't accept URLs at all. Store the return path server-side, or accept an ID that maps to a known route.
  • Client-side redirects (location.href = params.get('next')) can also be DOM XSS via javascript: URLs.

Interview questions

  • What is an open redirect and why does it matter?
  • Why is next.startsWith('/') not enough?
  • How would you design a safe "return to" feature?

Prototype pollution

Prototype pollution is when attacker-controlled keys like __proto__ make a merge or set function write to Object.prototype, changing the behaviour of every object.

  • Unsafe recursive merge, clone, set-by-path (set(obj, 'a.b.c', v)) and query-string parsers that follow __proto__, constructor or prototype keys can write to Object.prototype.
  • JSON.parse('{"__proto__": {...}}') creates an own property named __proto__. A later naive merge then does target['__proto__'], which is the real prototype.
  • Impact: auth bypass (if (user.isAdmin)), changed options ({}.shell), DoS, and on the client DOM XSS through script gadgets (libraries reading a missing option like options.innerHTML).
  • Defences: skip dangerous keys, use Object.create(null) or Map for dictionaries, check Object.hasOwn, validate input with a schema, and keep libraries (lodash, minimist, etc.) updated.
  • Hardening: Object.freeze(Object.prototype) at startup (can break some libraries), and Node's --disable-proto=delete flag removes the __proto__ accessor.
  • Related: never use user input as a property name for method calls (obj[userKey]()).

Interview questions

  • What is prototype pollution?
  • How do you prevent it?
  • How can prototype pollution lead to XSS in the browser?

The big picture

OWASP Top 10 mapped to the frontend

The OWASP Top 10 is the industry list of the most critical web app risks; know the 2021 list, the 2025 update, and where the frontend fits.

  • 2021: A01 Broken Access Control, A02 Cryptographic Failures, A03 Injection (XSS joined it), A04 Insecure Design, A05 Security Misconfiguration, A06 Vulnerable and Outdated Components, A07 Identification and Authentication Failures, A08 Software and Data Integrity Failures, A09 Security Logging and Monitoring Failures, A10 SSRF.
  • 2025 (released by OWASP): Broken Access Control stays #1 and absorbs SSRF; Security Misconfiguration rises to #2; Software Supply Chain Failures (#3) expands "Vulnerable and Outdated Components"; Mishandling of Exceptional Conditions is new at #10.
  • The frontend is never an access-control boundary. Hiding a button is UX; the server must check permissions on every request.
  • Most frontend-owned risks: XSS (Injection), misconfigured headers/CORS (Misconfiguration), npm and CDN dependencies (Supply Chain), token handling (Authentication), missing SRI (Integrity).
  • Use it as a checklist in design reviews, alongside the OWASP ASVS for detailed requirements and the OWASP Cheat Sheet Series for fixes.

Interview questions

  • What is the OWASP Top 10 and what is #1?
  • What changed in the OWASP Top 10:2025?
  • Which OWASP risks are most relevant to a frontend engineer?
  • Can you enforce authorization in the frontend?