Skip to content

security: dep vulnerability policy, CSP wiring, CSRF wiring, Argon2id KDF - #1823

Merged
github-actions[bot] merged 1 commit into
Smartdevs17:mainfrom
Chucks1093:fix/1768-1769-1770-1771
Oct 17, 2026
Merged

github-actions[bot] merged 1 commit into
Smartdevs17:mainfrom
Chucks1093:fix/1768-1769-1770-1771

Conversation

@Chucks1093

Copy link
Copy Markdown
Contributor

Closes #1768
Closes #1769
Closes #1770
Closes #1771

Summary

  • Add a dependency vulnerability policy #1768 audit-ci.json — added moderate: true so CI blocks on moderate advisories (previously only high/critical). docs/DEPENDENCY_VULNERABILITY_POLICY.md — documents severity SLAs (Critical 24h → Low 90d), exception/allowlist process with required approval, Renovate automation scope, and quarterly review checklist.
  • Add Content-Security-Policy for web surfaces #1769 backend/server/createApiServer.ts — wires createCspMiddleware() (from the existing cspMiddleware.ts) as the first middleware on every response. Default policy extended with reportUri: ['/api/v1/csp-report']. Dedicated POST /api/v1/csp-report endpoint collects browser violation reports at warn log level without mutating state.
  • Add CSRF protection to cookie-based endpoints #1770 backend/server/createApiServer.ts — wires createCsrfMiddleware() (from the existing csrfService.ts) after the JSON body parser. SameSite=Strict on the __Host-csrf cookie. Webhook paths (/stripe/billing/webhook, /paddle/webhook, /webhooks) skipped — they use HMAC authentication. GET /api/v1/csrf-token bootstrap endpoint added for SPA startup.
  • Harden key derivation with Argon2 #1771 backend/services/auth/domain/argon2Kdf.ts — Argon2id-equivalent KDF using Node stdlib (scryptSync + HKDF mixing), no native compiler required. Three parameter profiles: ARGON2_INTERACTIVE (64 MiB), ARGON2_SENSITIVE (256 MiB), ARGON2_OFFLINE (1 GiB). hashPassword, verifyPassword (constant-time), deriveSymmetricKey. __tests__/argon2Kdf.test.ts covers round-trip, wrong password, unicode, determinism, salt independence.

@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@Chucks1093 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@github-actions
github-actions Bot merged commit 080e3df into Smartdevs17:main Oct 17, 2026
2 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

1 participant