Skip to content

fix(security): harden HTTP headers#83

Merged
nanaf6203-bit merged 1 commit into
StellarTips:mainfrom
singhvishalkr:fix/security-headers-64
Jun 20, 2026
Merged

fix(security): harden HTTP headers#83
nanaf6203-bit merged 1 commit into
StellarTips:mainfrom
singhvishalkr:fix/security-headers-64

Conversation

@singhvishalkr

Copy link
Copy Markdown
Contributor

Problem

The backend enabled Helmet with default options and allowed credentialed CORS even when CORS_ORIGIN=* was configured. That left security headers and production CORS behavior less explicit than the API needs.

Solution

  • Added a typed security config module for Helmet, CORS, and Permissions-Policy.
  • Configured CSP, HSTS preload, referrer policy, frameguard, no-sniff, XSS protection, and cross-domain policy headers.
  • Tightened CORS so wildcard origins do not allow credentials, while specific origins do.
  • Added response-header coverage for the configured middleware.
  • Documented the header and CORS behavior in docs/SECURITY.md.

Closes #64

Verification

  • npm.cmd ci
  • npm.cmd test -- security.config.spec.ts --runInBand
  • npm.cmd run build
  • npx.cmd eslint src/config/security.config.ts src/config/security.config.spec.ts src/main.ts
  • npx.cmd prettier --check docs/SECURITY.md src/config/security.config.ts src/config/security.config.spec.ts src/main.ts
  • npx.cmd tsc --noEmit
  • git diff --check

@nanaf6203-bit nanaf6203-bit merged commit 871791a into StellarTips:main Jun 20, 2026
5 checks passed

Copy link
Copy Markdown
Contributor

Helmet + CORS + Permissions-Policy hardening looks great, and typed Helmet config in security.config.ts is the right call. Merged.

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.

Add CSP, HSTS, and other security headers via Helmet configuration

2 participants