Skip to content

security: harden HTTP transport - #22

Merged
Macawls merged 2 commits into
mainfrom
security/http-hardening
Mar 26, 2026
Merged

security: harden HTTP transport#22
Macawls merged 2 commits into
mainfrom
security/http-hardening

Conversation

@Macawls

@Macawls Macawls commented Mar 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Credentials moved from URL query params to X-Umami-* headers (query params still work as deprecated fallback)
  • Configurable CORS origin restriction via ALLOWED_ORIGINS env var
  • 1MB request body size limit to prevent OOM
  • Session limit via MAX_SESSIONS env var (default 1000) with atomic counter
  • websiteID validation to prevent path injection

New Environment Variables

Variable Default Description
ALLOWED_ORIGINS * Comma-separated CORS allowed origins
MAX_SESSIONS 1000 Maximum concurrent HTTP sessions

Test plan

  • All existing tests updated and passing
  • Header-based auth test
  • Query param fallback test (deprecated path)
  • Missing credentials returns -32602
  • Body >1MB returns 413
  • CORS origin restriction test
  • Session limit test
  • Session limit recovery after delete
  • websiteID validation (UUID, path traversal, special chars)

Closes #19

🤖 Generated with Claude Code

Macawls and others added 2 commits March 26, 2026 21:31
…on limit, input validation)

- Move credentials from query params to X-Umami-* headers with query param fallback (deprecated)
- Add configurable CORS origin restriction via ALLOWED_ORIGINS env var
- Add 1MB request body size limit to prevent OOM
- Add session limit (MAX_SESSIONS, default 1000) with atomic counter
- Add websiteID validation to prevent path injection
- Update README with new auth approach and env var documentation

Closes #19

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Macawls
Macawls merged commit bf7f5a3 into main Mar 26, 2026
11 checks passed
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.

Security: credentials in URL query string, CORS wildcard, missing input validation, DoS vectors

1 participant