Trust, security and accessibility
Security headers including a real CSP and the compromise it requires, the API validation pipeline, timing-safe secret comparison, and the accessibility work that is also SEO work.
6 min read · updated 2026-07-26· last reviewed 2026-07-26
Six headers, each preventing a specific attack, all set once in one module. There is no judgement involved in five of them. The sixth, CSP, requires a real decision.
A strict script-src on a statically prerendered React app requires one of three things:
The rest of "Trust, security and accessibility"
1,244 words covering 6 sections, with the implementation code for 12 checks. The table of contents below is the full outline, so you can see exactly what is behind this.
Already bought it? Read it in your library.
What this chapter covers
- The headers, and what each one prevents
- The principle
- The implementation
- CSP, and the compromise nobody writes down
- The principle
- The implementation
- The API validation pipeline
- The principle
- The implementation
- Timing-safe comparison
- The principle
- The implementation
- Accessibility is also indexing
- The principle
- The implementation
- Consent that actually gates
- The principle
- The implementation
Checks this chapter covers
Each one has a command you can run against your own site.
- →HSTS with a long max-age, includeSubDomains and preloadsec-hsts
- →X-Content-Type-Options nosniffsec-nosniff
- →Framing denied through both X-Frame-Options and frame-ancestorssec-frame-deny
- →Referrer-Policy set to strict-origin-when-cross-originsec-referrer-policy
- →Permissions-Policy denying camera, microphone, geolocation and paymentsec-permissions-policy
- →A real Content-Security-Policy, with the compromises documentedsec-csp
- →Secret comparison is timing-safe, with a deliberate delay on failuresec-timing-safe-compare
- →Every write endpoint runs the same validation pipeline in the same ordersec-api-validation-pipeline
- →Every interactive element is keyboard reachable with a visible focus ringa11y-keyboard-operable
- →Semantic landmarks and a skip link as the first focusable elementa11y-landmarks-skip-link
- →Terms, privacy, licence and refund pages exist, are linked sitewide, and name real processorstrust-legal-pages
- →The consent banner genuinely prevents analytics from loading before consenttrust-consent-gates-analytics