HTTP security headers for rummerlab.com are set in two places. Values should stay aligned so a Cloudflare or host change does not silently drop protection.
| Header | Cloudflare (edge) | Next.js (next.config.ts via lib/security-headers.ts) |
|---|---|---|
Strict-Transport-Security |
max-age=63072000 |
max-age=63072000; includeSubDomains; preload |
X-Frame-Options |
SAMEORIGIN |
SAMEORIGIN |
X-Content-Type-Options |
nosniff |
nosniff (also on /images/* cache rule) |
Referrer-Policy |
same-origin |
same-origin |
Permissions-Policy |
— | camera=(), microphone=(), geolocation=() |
Content-Security-Policy |
— | Enforcing policy (see below) |
X-XSS-Protection |
1; mode=block (legacy) |
Not set (deprecated; CSP is preferred) |
Cloudflare also adds expect-ct and NEL/reporting headers. Those are edge-only and not duplicated in the app.
Production currently receives core headers from Cloudflare (Server: cloudflare). The Next.js config codifies the same policy in git so headers survive infra changes and are reviewable in pull requests. Duplicate headers with identical values are harmless.
If Cloudflare Transform Rules or Security Headers are updated, update lib/security-headers.ts to match.
The enforcing CSP covers:
- Analytics: Google Analytics (
@next/third-parties), Vercel Analytics, Speed Insights - Embeds: Google Maps (contact page), OpenStreetMap umap (Physioshark page)
- Maps (MapLibre):
maps.wanderstories.space+ Carto basemap CDN inconnect-src/img-src/font-src;worker-src 'self' blob:for MapLibre workers - Images: All hostnames in
next.config.tsimages.remotePatterns(mirrored inIMAGE_HOSTSin lib/security-headers.ts). Includesscholar.google.comfor default Scholar avatars (/citations/images/avatar_scholar_256.png) when googleusercontent photo URLs redirect. - Styles/scripts:
'unsafe-inline'for Next.js hydration and Tailwind (nonce-based CSP is a future improvement) - Development only:
'unsafe-eval'is added toscript-srcwhenNODE_ENV !== 'production'so React DevTools work; it is never allowed in production
The scholar embed widget (/embed/scholar.js) is loaded on external collaborator sites; their CSP applies there, not ours.
- Policy was drafted against known third parties in the codebase.
- Enforcing
Content-Security-Policyis active by default in lib/security-headers.ts. - To test without blocking, set
CSP_REPORT_ONLY=1at build time to emitContent-Security-Policy-Report-Onlyinstead. - If violations appear after deploy, temporarily switch to report-only, fix violations, then re-enable enforcement.
After changing headers:
curl.exe -sI https://rummerlab.comCheck securityheaders.com and smoke-test homepage, a podcast article, contact (Maps), Physioshark (map iframe), and /api/scholar/ynWS968AAAAJ.
proxy.ts sets Access-Control-Allow-Origin: * on /api/* so collaborator sites can use the scholar embed API. This is intentional product behavior.