Add security hardening: helmet, CORS allowlist, body limit, ID validation #8

Open
iswa wants to merge 1 commits from security/fix-footguns into master
Owner
  • Install and configure helmet with basic CSP in app.js
  • Restrict CORS to ALLOWED_ORIGIN env var (default localhost:5173)
  • Add express.json 1mb body size limit to prevent memory exhaustion
  • Add parseInt+isNaN validation for all :id route params in bills.js
    and financing.js (GET/PUT/DELETE/:id and PATCH financing-payments/:id)
  • Extend bills.routes.test.js and financing.routes.test.js with ID
    validation tests (non-numeric IDs → HTTP 400)

Nightshift-Task: security-footgun
Nightshift-Ref: https://github.com/marcus/nightshift

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com

- Install and configure helmet with basic CSP in app.js - Restrict CORS to ALLOWED_ORIGIN env var (default localhost:5173) - Add express.json 1mb body size limit to prevent memory exhaustion - Add parseInt+isNaN validation for all :id route params in bills.js and financing.js (GET/PUT/DELETE/:id and PATCH financing-payments/:id) - Extend bills.routes.test.js and financing.routes.test.js with ID validation tests (non-numeric IDs → HTTP 400) Nightshift-Task: security-footgun Nightshift-Ref: https://github.com/marcus/nightshift Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
iswa added 1 commit 2026-03-20 08:26:39 -07:00
- Install and configure helmet with basic CSP in app.js
- Restrict CORS to ALLOWED_ORIGIN env var (default localhost:5173)
- Add express.json 1mb body size limit to prevent memory exhaustion
- Add parseInt+isNaN validation for all :id route params in bills.js
  and financing.js (GET/PUT/DELETE/:id and PATCH financing-payments/:id)
- Extend bills.routes.test.js and financing.routes.test.js with ID
  validation tests (non-numeric IDs → HTTP 400)

Nightshift-Task: security-footgun
Nightshift-Ref: https://github.com/marcus/nightshift

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This pull request has changes conflicting with the target branch.
  • CLAUDE.md
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin security/fix-footguns:security/fix-footguns
git checkout security/fix-footguns
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: iswa/budget-app#8