Skip to content

Security fix: isolate health checks from admin API rate-limit bucket - #126

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/application-security-review-2672
Draft

Security fix: isolate health checks from admin API rate-limit bucket#126
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/application-security-review-2672

Conversation

@cursor

@cursor cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Security review finding (Medium)

Issue: #125

Location: src/rate_limit.rs

Impact: Unauthenticated GET /api/v1/health shared the authenticated /api/* rate-limit bucket ({client_ip}:api). A remote attacker on the same source IP (NAT, reverse proxy, or co-located monitoring) could exhaust the 120/min default budget and block legitimate admin API calls (POST/DELETE /api/v1/streams, etc.) with 429 until the window resets.

Attack path:

  • Attacker: unauthenticated remote client
  • Input: repeated health probes
  • Path: rate_limit::middleware runs before auth; all /api/* paths map to the api bucket
  • Impact: admin API denial of service for the shared client IP

Fix

Classify /api/v1/health into a separate health bucket using default_max, so orchestrator probes no longer consume the authenticated admin API budget.

Tests

  • rate_limit::tests::health_uses_separate_bucket_from_authenticated_api
  • http::tests::health_rate_limit_does_not_exhaust_authenticated_api_budget
  • Updated api_rate_limit_returns_429_when_exceeded to target protected routes

All 110 unit tests pass.

Open in Web View Automation 

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

cursoragent and others added 2 commits August 6, 2026 02:07
Public GET /api/v1/health shared the authenticated /api/* rate-limit
bucket, so unauthenticated health probes could exhaust the admin API
budget for the same client IP and deny stream management requests.

Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
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