π Description
middleware/securityHeaders.ts sets defensive headers (X-Content-Type-Options, X-Frame-Options, etc.) per the README, but doesn't appear to set Cache-Control β meaning responses from GET /api/v1/audit (recent mutating request history) or settlement/anchor detail views could be cached by an intermediary proxy or the browser's back-forward cache, exposing potentially sensitive operational data longer than intended.
π§© Requirements and context
- Set
Cache-Control: no-store on all mutating (POST/PUT/PATCH/DELETE) responses and on GET /api/v1/audit.
- Leave caching headers for genuinely cacheable read endpoints (if any) unaffected β this should be a targeted addition, not global.
- Confirm no existing test asserts the absence of this header (would need updating if so).
π οΈ Suggested execution
- Extend
middleware/securityHeaders.ts or add a small targeted middleware applied to the relevant routers.
- Add tests in
middleware/securityHeaders.test.ts and/or the affected route test files.
- Update the README's security-headers bullet list.
β
Acceptance criteria
π Security notes
Reduces the window during which sensitive operational responses could be retained by intermediary caches.
π Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
π Description
middleware/securityHeaders.tssets defensive headers (X-Content-Type-Options,X-Frame-Options, etc.) per the README, but doesn't appear to setCache-Controlβ meaning responses fromGET /api/v1/audit(recent mutating request history) or settlement/anchor detail views could be cached by an intermediary proxy or the browser's back-forward cache, exposing potentially sensitive operational data longer than intended.π§© Requirements and context
Cache-Control: no-storeon all mutating (POST/PUT/PATCH/DELETE) responses and onGET /api/v1/audit.π οΈ Suggested execution
middleware/securityHeaders.tsor add a small targeted middleware applied to the relevant routers.middleware/securityHeaders.test.tsand/or the affected route test files.β Acceptance criteria
GET /api/v1/auditincludeCache-Control: no-store.π Security notes
Reduces the window during which sensitive operational responses could be retained by intermediary caches.
π Guidelines