Files
nick-doc/Issues/ISSUE-083-frontend-no-content-security-policy-header-in-next-config.md
Siavash Sameni dceaf82934 audit: 2026-05-30 full-codebase audit — report, issues, docs, runbooks
Full-codebase-audit 2026-05-30 outputs:
- Audit report: 09 - Audits/Full Codebase Audit - 2026-05-30.md
- 81 issue files ISSUE-055..135 (decisions + 1 skipped no-brainer).
- Scanner docs from scratch (was zero): architecture, data model, API ref, payment
  flow, operations runbook + repo README.
- Doc-sync updates across API reference, data models, flows, design system.
- Secret Rotation Runbook (08 - Operations) for the exposed credentials.
- Reusable workflow guide (07 - Development) + .claude/workflows/full-codebase-audit.js.

Issues remain status:open intentionally — the code fixes are uncommitted-then-committed
working-tree changes per repo and aren't "resolved" until merged/deployed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 18:48:04 +04:00

40 lines
1.4 KiB
Markdown

---
issue: 083
title: "Frontend: no Content-Security-Policy header in Next.js config"
severity: medium
domain: Security
labels: [security, frontend, csp]
status: open
created: 2026-05-30
source: Full Codebase Audit 2026-05-30
---
# Frontend: no Content-Security-Policy header in Next.js config
**Severity:** medium
**Domain:** Security
**Labels:** security, frontend, csp
## Description
`next.config.ts:29` does not set a `Content-Security-Policy` header. Without CSP, XSS attacks have unrestricted script execution, making token theft (localStorage) and DOM-based attacks much easier.
## Options
1. Ship `Content-Security-Policy-Report-Only` first to collect violations, then enforce — safe rollout.
2. Enforce a moderate CSP allowing required hosts (Telegram, WalletConnect, Mapbox, Sentry) with nonces for inline scripts.
3. Strict CSP with nonces and removal of all inline scripts — strongest but requires refactoring `layout.tsx` inline scripts.
## Recommendation
Ship `Content-Security-Policy-Report-Only` first, gather violations for a week, then enforce. Inline scripts in `layout.tsx` must move to nonces. Non-trivial rollout.
## Affected Files
- `frontend/next.config.ts:29`
- `frontend/src/app/layout.tsx` — inline scripts that need nonces
## References
- [Full Codebase Audit 2026-05-30](../09%20-%20Audits/Full%20Codebase%20Audit%20-%202026-05-30.md) — DEC-8