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
feat: security hardening with replay store, metrics, and rate limits
- Add optional Redis-backed replay store: authorization codes become
strictly single-use and refresh tokens rotate with reuse detection
(OAuth 2.1 §6.1 / RFC 6749 §10.4). Without REDIS_URL the proxy stays
stateless and keeps its existing replay-within-TTL semantics.
- Add REDIS_KEY_PREFIX (default "mcp-auth-proxy:") so multiple proxy
deployments can safely share a single Redis DB.
- Reject id_tokens with email_verified=false so an IdP accepting
self-signup can't impersonate arbitrary email identities upstream.
- Rate-limit pre-auth endpoints per IP to cap the cost of unauthenticated
AES-GCM work and the /callback IdP token-exchange amplifier.
- Tighten authorization code TTL from 5min to 60s per OAuth 2.1 §4.1.3.
- Harden the reverse proxy: 16 MiB request-body cap, 30s
ResponseHeaderTimeout, redirect-exhaustion returns the last response
(no request replay), inbound X-User-* stripped before trusted values
are injected.
- Strip inbound X-Request-Id before chi mints one, to prevent log-forgery
via client-controlled request IDs.
- Accept case-insensitive "Bearer" per RFC 6750 §2.1.
- Emit Prometheus business counters (tokens_issued, access_denied,
replay_detected, rate_limited, clients_registered) so security events
are alertable without scraping logs.
- Split liveness (/healthz) from readiness (/readyz); /readyz probes
Redis when configured so K8s drops degraded pods from the Service.
- Retry OIDC discovery with exponential backoff so a transient IdP blip
at pod start doesn't burn a CrashLoopBackoff slot.
- Switch container base to gcr.io/distroless/static-debian13:nonroot,
drop marvinpinto@latest in favour of gh release create, tighten CI
job permissions to contents:read where write isn't required.
- Add Go fuzz targets on the AES-GCM open path (FuzzOpenJSON,
FuzzValidate) and miniredis-backed tests covering prefix isolation
across deployments.
0 commit comments