🔒 Technical Security Controls
🎯 Implementing defense-in-depth for client-side applications
📋 Document Owner: CEO | 📄 Version: 1.0 | 📅 Last Updated: 2025-11-10 (UTC)
🔄 Review Cycle: Quarterly | ⏰ Next Review: 2026-02-10
This document explains the security headers implemented to address vulnerabilities identified in the ZAP (Zed Attack Proxy) full scan, in compliance with Hack23 AB's ISMS Secure Development Policy.
GitHub Pages does not support custom HTTP headers, so security controls must be implemented through HTML meta tags with http-equiv attributes. While not as robust as HTTP headers, these meta tags provide meaningful security improvements for client-side rendered applications.
This implementation aligns with:
- Secure Development Policy - Security testing and DAST requirements
- Information Security Policy - Security controls implementation
Meta Tag:
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: blob:; font-src 'self'; connect-src 'self'; media-src 'self' blob:; worker-src 'self' blob:; frame-ancestors 'none'; base-uri 'self'; form-action 'self';" />Purpose: Restricts the sources from which various types of content can be loaded.
Directives Explained:
default-src 'self'- Only load resources from same origin by defaultscript-src 'self'- Only execute scripts from same originstyle-src 'self' 'unsafe-inline'- Allow same-origin styles and inline styles (required by React)img-src 'self' data: blob:- Allow images from same origin, data URIs, and blob URLs (required by Three.js)font-src 'self'- Only load fonts from same originconnect-src 'self'- Only allow connections to same originmedia-src 'self' blob:- Allow media from same origin and blob URLs (required by audio)worker-src 'self' blob:- Allow web workers from same origin and blob URLsframe-ancestors 'none'- Prevent page from being embedded in frames (clickjacking protection)base-uri 'self'- Restrict base tag URLs to same originform-action 'self'- Restrict form submission targets to same origin
ZAP Issues Addressed:
- ✅ Content Security Policy (CSP) Header Not Set [10038]
- ✅ CSP: Failure to Define Directive with No Fallback [10055]
- ✅ CSP: style-src unsafe-inline [10055] (acceptable for React applications)
Meta Tag:
<meta http-equiv="X-Frame-Options" content="DENY" />Purpose: Prevents the page from being displayed in a frame, iframe, embed, or object tag.
ZAP Issues Addressed:
- ✅ Missing Anti-clickjacking Header [10020]
Meta Tag:
<meta http-equiv="X-Content-Type-Options" content="nosniff" />Purpose: Prevents browsers from MIME-sniffing responses, reducing exposure to drive-by download attacks.
ZAP Issues Addressed:
- ✅ X-Content-Type-Options Header Missing [10021]
Meta Tag:
<meta name="referrer" content="strict-origin-when-cross-origin" />Purpose: Controls how much referrer information is included with requests.
Policy Explained:
- Same-origin requests: Full URL sent as referrer
- Cross-origin HTTPS requests: Only origin sent as referrer
- HTTPS→HTTP requests: No referrer sent
Meta Tag:
<meta http-equiv="X-XSS-Protection" content="1; mode=block" />Purpose: Enables the Cross-Site Scripting (XSS) filter built into most browsers.
Note: Modern browsers have deprecated this header in favor of CSP, but it's included for older browser support.
Meta Tag:
<meta http-equiv="Permissions-Policy" content="geolocation=(), microphone=(), camera=(), payment=(), usb=(), magnetometer=(), gyroscope=(), accelerometer=()" />Purpose: Controls which browser features and APIs can be used in the document.
Features Disabled:
- Geolocation API
- Microphone access
- Camera access
- Payment Request API
- USB device access
- Magnetometer
- Gyroscope
- Accelerometer
Meta Tags:
<meta http-equiv="Cross-Origin-Opener-Policy" content="same-origin" />
<meta http-equiv="Cross-Origin-Resource-Policy" content="same-origin" />Purpose: Mitigates Spectre-style attacks by isolating the browsing context.
Policies Explained:
Cross-Origin-Opener-Policy: same-origin- Isolates the browsing context to same-origin documents onlyCross-Origin-Resource-Policy: same-origin- Prevents other origins from reading the resource
ZAP Issues Addressed:
- ✅ Insufficient Site Isolation Against Spectre Vulnerability [90004]
Issue: Strict-Transport-Security Header Not Set [10035]
Status:
Explanation: The Strict-Transport-Security header cannot be set via meta tags. However:
- GitHub Pages serves all content over HTTPS by default
- GitHub Pages automatically redirects HTTP requests to HTTPS
- The security benefit is largely achieved through GitHub's infrastructure
Recommendation: This is acceptable for GitHub Pages deployments as the infrastructure enforces HTTPS.
Issue: CORS Misconfiguration [40040]
Status:
Explanation: CORS headers must be set by the server and cannot be controlled via HTML meta tags. For GitHub Pages:
- GitHub Pages sets appropriate CORS headers
- All resources are served from the same origin
- No cross-origin resource sharing is required for this application
Recommendation: No action needed as the application doesn't require CORS.
All security headers are validated by automated tests in src/test/security-headers.test.ts:
- ✅ 11 security header tests
- ✅ Validates presence of all meta tags
- ✅ Verifies correct content values
- ✅ Ensures React and Three.js compatibility
To verify the security headers are present:
-
Build the application:
npm run build
-
Check the output:
cat dist/index.html | grep "http-equiv"
-
Run security tests:
npm run test -- src/test/security-headers.test.ts
Meta tags with http-equiv are supported by:
- ✅ Chrome/Edge (all modern versions)
- ✅ Firefox (all modern versions)
- ✅ Safari (all modern versions)
- ✅ Mobile browsers
Note: While not as strong as HTTP headers, these meta tags provide meaningful security improvements for browsers that respect them.
If migrating from GitHub Pages to a platform with HTTP header support (e.g., Netlify, Vercel):
- Convert meta tags to HTTP headers
- Add
Strict-Transport-Securityheader with appropriate max-age - Consider adding
Content-Security-Policy-Report-Onlyfor monitoring - Implement proper CORS configuration if needed
- 🔒 SECURITY.md - Security policy and vulnerability reporting
- 📊 ISMS Policy Mapping - Feature-to-policy mapping
- 📖 README.md - Project overview
- 🔐 Information Security Policy - Overall security governance
- 🛠️ Secure Development Policy - SDLC and security testing requirements
- 🔍 Vulnerability Management - Security vulnerability handling
- 🏷️ Classification Framework - CIA triad and impact levels
📋 Document Control:
✅ Approved by: James Pether Sörling, CEO
📤 Distribution: Public
🏷️ Classification:
📅 Effective Date: 2025-11-10
⏰ Next Review: 2026-02-10
🎯 Framework Compliance: