[pentest] Missing security headers and no HSTS; HTTP->HTTPS redirect reflects arbitrary Host header #67

Closed
opened 2026-09-09 14:10:09 +00:00 by poslop · 1 comment
Owner

Observed on dev build:

  1. Responses (port 443 and 80) carry no CSP, X-Frame-Options, HSTS, or Referrer-Policy headers (only content-type, set-cookie). Paste pages render user-controlled titles; defense-in-depth absent.
  2. curl -H 'Host: evil.example.com' http://10.0.1.47/ -> 301 Location: https://evil.example.com/ - the HTTP->HTTPS redirect blindly reflects the attacker-supplied Host header (host-header injection / cache poisoning vector where a proxy caches the redirect).

Recommend: set HSTS, CSP, X-Content-Type-Options (present only on /raw), X-Frame-Options; derive redirect location from allowlist.

Observed on dev build: 1. Responses (port 443 and 80) carry **no** CSP, X-Frame-Options, HSTS, or Referrer-Policy headers (only content-type, set-cookie). Paste pages render user-controlled titles; defense-in-depth absent. 2. `curl -H 'Host: evil.example.com' http://10.0.1.47/` -> `301 Location: https://evil.example.com/` - the HTTP->HTTPS redirect blindly reflects the attacker-supplied Host header (host-header injection / cache poisoning vector where a proxy caches the redirect). Recommend: set HSTS, CSP, X-Content-Type-Options (present only on /raw), X-Frame-Options; derive redirect location from allowlist.
Author
Owner

Fully remediated and live-verified 2026-09-09:

  • App security headers: merged via PR #76 (CSP, Referrer-Policy, nosniff on all HTML)
  • HSTS: Traefik entrypoint middleware kube-system-hsts@kubernetescrd (max-age=31536000, includeSubDomains, preload) - verified on palette + palette-dev
  • HTTP->HTTPS: Traefik web entrypoint now 308-redirects to websecure (no more Host-reflection, fixed target)
  • Other services on the proxy (gitea etc) verified unaffected

Changes committed in poslop/k3s (values.yaml + hsts-middleware.yaml).

Fully remediated and live-verified 2026-09-09: - App security headers: merged via PR #76 (CSP, Referrer-Policy, nosniff on all HTML) - HSTS: Traefik entrypoint middleware `kube-system-hsts@kubernetescrd` (max-age=31536000, includeSubDomains, preload) - verified on palette + palette-dev - HTTP->HTTPS: Traefik web entrypoint now 308-redirects to websecure (no more Host-reflection, fixed target) - Other services on the proxy (gitea etc) verified unaffected Changes committed in poslop/k3s (values.yaml + hsts-middleware.yaml).
Sign in to join this conversation.