Security
Guides in Security. Written like documentation — short paragraphs, real examples, interview-relevant depth.
XSS for Frontend Engineers
intermediateHow cross-site scripting reaches UI sinks, what React/HTML escaping does and doesn’t save, and layered defenses.
intermediate
Frontend Security Threat Model
intermediateThreat-model SPAs: assets, attackers, XSS/CSRF/supply-chain, and where frontend controls actually land.
intermediate
XSS Prevention Checklist
intermediateActionable XSS checklist: sinks, sanitization, CSP, cookies, URLs, markdown, and PR review prompts.
intermediate
CSRF Basics for SPAs
intermediateCross-site request forgery against cookie sessions: SameSite, CSRF tokens, and SPA fetch patterns.
intermediate
Content Security Policy (CSP)
advancedReduce XSS blast radius with CSP — script-src nonces/hashes, strict-dynamic, report-only rollout, and what CSP does not fix.
advanced
Secure Cookie Flags
intermediateHttpOnly, Secure, SameSite, Path, Domain, and Priority: set session cookies so XSS and CSRF have less room.
intermediate
JWT Storage Pitfalls
intermediateWhy localStorage JWTs are XSS bait, cookie alternatives, refresh patterns, and SPA session designs that age better.
intermediate
Open Redirects
intermediateUnsafe redirect targets in login return URLs and how to allowlist paths without breaking product flows.
intermediate
Clickjacking and X-Frame-Options
intermediateStop UI redress attacks with frame-ancestors CSP and X-Frame-Options; know when embedding is intentional.
intermediate
Subresource Integrity
intermediateSRI hashes on script/link tags so CDN tampering fails closed; generate integrity and pair with CSP.
intermediate
Dependency Supply Chain Risk
intermediatenpm malware, lockfiles, pin policies, and practical frontend controls against dependency attacks.
intermediate
Secrets in Frontend Bundles
beginnerAPI keys in React env vars are public: what’s safe in the browser, map keys, and how leaks happen.
beginner
HTTPS and Mixed Content
beginnerTLS everywhere, HSTS, and mixed active/passive content blocks that break modern browsers.
beginner
Safe URL Handling
intermediateValidate href/src/navigation targets: block javascript: and data: traps, open redirects, and XSS via URLs.
intermediate
postMessage Security
advancedSecure window.postMessage: targetOrigin, event.origin checks, schema validation, and iframe bridges.
advanced
Sandboxing iframes
advancediframe sandbox flags explained: lock down embeds, re-enable only needed capabilities, combine with CSP.
advanced
Auth Session UX Security
intermediateSession UX that doesn’t weaken security: login states, logout everywhere, idle timeouts, and step-up auth.
intermediate
Rate Limiting UX Considerations
intermediateDesign FE for 429s: Retry-After, backoff, idempotency, and login lockouts without trapping users.
intermediate
Privacy and Fingerprinting Basics
advancedWhat browser fingerprinting collects, FE APIs that leak entropy, and privacy-preserving product defaults.
advanced