Implement the open $35 security-headers bounty for Lilly-Protocol/lily-frontend, validate the change, and prepare a pull request while keeping GitHub and payment information private.
- Target:
Lilly-Protocol/lily-frontend#109. - Scope was limited to the issue's requested response headers and documentation.
- The CSP allows the current Next.js shell's inline scripts/styles, keeps production free of
unsafe-eval, and permits only same-origin resources plusdata:/blob:assets needed by the current app. - No third-party hosts, payment details, credentials, or private messages were added to the repository.
- Added a
headers()rule innext.config.tsfor/:path*. - Added
Content-Security-Policy,Referrer-Policy,X-Content-Type-Options, andX-Frame-Options. - Added a unit test covering the route matcher and required directives.
- Documented the policy and future third-party integration considerations in
README.md.
npm cicompleted on Nodev24.14.0/ npm11.9.0.npm run lintpassed.npm run typecheckpassed.npm run test:runpassed: 6 files, 10 tests; coverage 96.29% statements, 90% branches, 100% functions, 96% lines.npm run buildpassed with Next.js16.2.6; 28 routes generated.npm run checkpassed.- Production server response checks passed for
/,/signin,/app,/security, and/robots.txt; all four required headers and the CSP were present. git diff --checkpassed.
npm cireported 9 dependency audit findings (1 low, 8 high) from the existing dependency graph; these were not changed because they are outside issue #109.- If a future feature adds analytics, APIs, remote fonts, embeds, or external images, the CSP must be reviewed and narrowed to the exact required hosts.
- GitHub maintainer review, merge, bounty approval, and payment are external gates and remain pending.
- The PR's Vercel status is currently failing at an authorization URL owned by the repository's deployment integration; this is an external deployment gate and does not contradict the passing local production build or header checks.
- Branch:
security-headers-109 - Config:
next.config.ts - Test:
src/config/security-headers.test.ts - Docs:
README.md - Quality record:
.planning/security-headers-109/quality-gates.json - Verify locally:
npm run check