Cybersecurity and AI Architecture Fellow of the British Computer Society (FBCS)
2-Day Course · Intermediate · Hands-on
Frontend Security · SEC-331

Secure Frontend Development

Defend the browser. This two-day course covers the full frontend attack surface: XSS (reflected, stored, DOM-based, mutation), CSP configuration, secure cookies, CSRF, SRI, client-side storage, postMessage, and framework-specific security for React, Angular and Vue. Hands-on labs against vulnerable frontends.

SEC-331. The syllabus

Two days, defending the browser

Covers every frontend attack vector and the defenses for each. Framework-specific modules for React, Angular and Vue. (Times are approximate.)

Day 1 Morning

XSS Deep Dive

S1-00 XSS Deep Dive: Reflected and Stored 1.5 hrs

Go beyond basic XSS. Exploit reflected XSS through URL parameters, headers, and error messages. Exploit stored XSS through form inputs, file names, and metadata fields. Cover filter evasion techniques, polyglot payloads, and how WAFs can be bypassed. Then implement the layered defense: encoding, CSP, and input validation.

S1-01 XSS Deep Dive: DOM-Based and Mutation 1.5 hrs

DOM-based XSS never touches the server. Exploit innerHTML, document.write, eval, and jQuery sinks. Cover mutation XSS (mXSS) where the browser's HTML parser transforms safe-looking input into executable code. Implement defenses: use textContent instead of innerHTML, avoid dangerous APIs, and deploy Trusted Types.

S1-02 CSP Configuration and Reporting 1.5 hrs

Content Security Policy is the strongest defense against XSS when configured correctly. Build a strict CSP from scratch: default-src, script-src with nonces, style-src, img-src, connect-src, frame-ancestors. Deploy CSP reporting (report-uri, report-to) and analyze real violations. Cover the common mistakes that make CSP ineffective.

S1-03 Secure Cookie Handling 1 hr

Cookies carry sessions, preferences, and tracking data. Set HttpOnly, Secure, SameSite (Strict or Lax), Domain, Path, and Max-Age/Expires correctly. Understand cookie prefixes (__Host- and __Secure-). Cover cookie theft via XSS, cookie fixation, and cookie tossing attacks.

Day 1 Afternoon

CSRF, SRI and Client-Side Storage

S1-04 CSRF Defense Patterns 1 hr

Implement CSRF protection using synchronizer tokens, double-submit cookies, and SameSite cookies. Understand why CORS preflight is not a CSRF defense. Cover CSRF in JSON APIs, multipart uploads, and login CSRF. Test each defense against a real CSRF attack.

S1-05 Subresource Integrity for Third-Party Resources 0.5 hr

When you load JavaScript or CSS from a CDN, you trust that CDN completely. SRI (Subresource Integrity) hashes verify that the file has not been tampered with. Implement SRI attributes, handle hash updates on library upgrades, and understand the fallback behavior.

S1-06 Client-Side Storage Security 1.5 hrs

localStorage, sessionStorage, IndexedDB and cookies each have different security properties. Understand what data is safe to store client-side (never tokens in localStorage), how XSS makes all client-side storage vulnerable, and how to minimize the blast radius. Implement secure patterns for each storage type.

S1-07 postMessage Security 1 hr

Cross-origin communication via postMessage is powerful and frequently exploited. Validate the origin of incoming messages. Restrict the target origin of outgoing messages. Cover the common mistakes: wildcard origins, missing origin checks, and trusting message data without validation.

Day 2

Framework Security and Labs

S1-08 React Security 1.5 hrs

React escapes JSX by default, but dangerouslySetInnerHTML, href with javascript: URLs, and server-side rendering introduce XSS risks. Cover React-specific security patterns, how to use DOMPurify safely, and how to configure CSP with React's rendering model.

S1-09 Angular Security 1 hr

Angular's DomSanitizer protects against XSS by default, but bypassSecurityTrustHtml and template injection can re-introduce it. Cover Angular-specific security: AOT compilation benefits, template injection via user-controlled templates, and safe binding patterns.

S1-10 Vue Security 1 hr

Vue escapes template expressions by default, but v-html and render functions introduce XSS. Cover Vue-specific security patterns, SSR security, and how to configure CSP with Vue's template compilation.

S1-11 Capstone Lab: Secure Frontend Audit 2 hrs

Given a frontend application (React, Angular, or Vue, your choice) with planted XSS, CSRF, storage, and CSP vulnerabilities, find each one, document it, and implement the fix. Score against a frontend security checklist.

S1-12 Course Wrap-Up and Frontend Security Checklist 0.5 hr

Review the frontend security checklist covering CSP, cookies, storage, framework-specific controls, and third-party script management. Cover ongoing monitoring and how to stay current with browser security features.

~26 hrs
Total instructional hours
22
Individual modules
2 days
Delivery days
Reserve a place

Secure the frontend, where your users are.

Two days of hands-on frontend security covering XSS, CSP, CSRF, client-side storage and framework-specific patterns for React, Angular and Vue.

2 days hands-on React/Angular/Vue covered Private corporate cohorts available
Reserve a Place

Corporate and sovereign cohorts, and bespoke on-site delivery, on request.