Skip to content

fix: add CSP and security headers for frontend deployment#189

Merged
Mosas2000 merged 1 commit intomainfrom
fix/csp-headers
Feb 26, 2026
Merged

fix: add CSP and security headers for frontend deployment#189
Mosas2000 merged 1 commit intomainfrom
fix/csp-headers

Conversation

@Mosas2000
Copy link
Copy Markdown
Owner

Closes #85

Changes

Add Netlify _headers file with comprehensive security headers:

  • Content-Security-Policy: Restricts script, style, image, font, and connection sources. Allows Stacks API endpoints (Hiro mainnet/testnet) and CoinGecko for price feeds. Blocks framing and restricts form actions.
  • X-Frame-Options: DENY - prevents clickjacking attacks
  • X-Content-Type-Options: nosniff - prevents MIME type sniffing
  • Referrer-Policy: strict-origin-when-cross-origin
  • Permissions-Policy: Disables camera, microphone, and geolocation APIs

These headers protect the financial application from XSS, clickjacking, and data injection attacks.

Configure Netlify _headers with:
- CSP restricting scripts to self, styles to self + unsafe-inline
  (required by Tailwind), connections to Stacks API and CoinGecko,
  images to self + data + https, and frame-ancestors to none
- X-Frame-Options: DENY to prevent clickjacking
- X-Content-Type-Options: nosniff to prevent MIME sniffing
- Referrer-Policy: strict-origin-when-cross-origin
- Permissions-Policy restricting camera, microphone, geolocation
@Mosas2000 Mosas2000 merged commit 9932ea8 into main Feb 26, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend build output lacks content security policy headers configuration

1 participant