Skip to content

fix: Close slow-client connections and harden the homepage and build - #6

Merged
Fuwn merged 11 commits into
mainfrom
chore/security-hardening
Nov 12, 2026
Merged

Fuwn merged 11 commits into
mainfrom
chore/security-hardening

Conversation

@Fuwn

@Fuwn Fuwn commented Nov 12, 2026

Copy link
Copy Markdown
Owner

The 15-second connection timeout restarted with every byte, so a client trickling its headers could hold a socket open indefinitely. A connection must now deliver a complete request within 15 seconds of being accepted or of its last response.

The rest resolves smaller findings from a security audit:

  • Limit counter names to 64 bytes rather than 64 graphemes.
  • Send the no-cache header on 405 responses.
  • Send a Content Security Policy with the homepage and nosniff with every response.
  • Warn at start-up when a remote PostgreSQL certificate goes unverified.
  • Truncate logged request paths after 256 characters.
  • Use a read-only CI token, and pin Actions and base images.

crystal spec and test/http_smoke.py pass against the built image, and the server closes a trickled request after 15 seconds.

@Fuwn
Fuwn merged commit f3d7444 into main Nov 12, 2026
2 checks passed
@Fuwn
Fuwn deleted the chore/security-hardening branch November 12, 2026 04:55
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