You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add three response-hardening actions so a matched rule mutates the outgoing response's headers
instead of blocking the whole response — the right mitigation for CORS misconfig, security-header
insertion, and cookie hardening:
- `set-header` + `set_headers: {name: value}` — set/overwrite, or `ensure: true` to add only when
absent (don't clobber an existing CSP/X-Frame-Options).
- `remove-header` + `remove_headers: [names]` — strip a header (e.g. Access-Control-Allow-Credentials
on a CORS misconfig, so the response is still served but not cross-origin-readable).
- `harden-cookie` — add missing HttpOnly/Secure/SameSite to Set-Cookie (no duplication;
`cookie_flags` overridable).
Plumbing: header mutations fold into the existing redact-verdict path; a `null` header value now
signals removal in both rebuildResponse (fetch) and the node path; rebuildResponse guards null-body
statuses (204/205/304/101) so hardening a redirect/no-body response doesn't throw. Block-mode-gated
(dry-run observes only), like redact/block. Not a default — authored + route-scoped.
+6 tests; 640 pass; typecheck clean.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments