Skip to content

fix: harden /response-headers, /redirect-to, /base64 and Digest auth - #761

Merged
harryjackson merged 1 commit into
masterfrom
security/close-serious-holes
Nov 12, 2026
Merged

harryjackson merged 1 commit into
masterfrom
security/close-serious-holes

Conversation

@harryjackson

Copy link
Copy Markdown
Collaborator

Security hardening for self-hosted instances: stricter validation of /response-headers values, safer /redirect-to handling (with an optional ALLOWED_REDIRECT_DOMAINS allowlist), X-Content-Type-Options: nosniff on every response, a charset on /base64, and a Digest auth fix (#463). httpbin.org already behaves this way.

Generated with Claude Code

- Every response carries X-Content-Type-Options: nosniff, and /response-headers
  cannot override it.
- /response-headers takes one valid Content-Type (it replaces application/json),
  HTML-escapes its echo under non-inert types, and accepts only the request host
  as a Set-Cookie Domain.
- /redirect-to refuses internal and malformed targets, takes an optional
  ALLOWED_REDIRECT_DOMAINS allowlist, accepts only absolute or rooted targets,
  and declares UTF-8 on its refusals.
- /base64 declares text/plain; charset=utf-8.
- Digest auth checks the username (#463).

httpbin.org already behaves this way.

Co-Authored-By: Claude <noreply@anthropic.com>
@harryjackson
harryjackson merged commit 5d04087 into master Nov 12, 2026
14 checks passed
@harryjackson
harryjackson deleted the security/close-serious-holes branch November 12, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant