Skip to content

Add Cache-Control: no-store to mutating and audit response headersΒ #99

Description

@Jagadeeshftw

πŸ“Œ 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

  • Mutating responses and GET /api/v1/audit include Cache-Control: no-store.
  • Other endpoints are unaffected.
  • Documented in README.

πŸ”’ 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

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox open-source programMaybe RewardedGrantFox: potentially rewarded contributionOfficial Campaign | FWC26GrantFox official campaign issueapiHTTP/WebSocket APIsecuritySecurity hardening

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions