Skip to content

fix: bound unauthenticated rate-limiter memory - #501

Merged
imran-siddique merged 1 commit into
mainfrom
agent/bound-health-rate-limiter
Aug 11, 2026
Merged

fix: bound unauthenticated rate-limiter memory#501
imran-siddique merged 1 commit into
mainfrom
agent/bound-health-rate-limiter

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

Summary

Bound the state retained by the unauthenticated /health and /readyz per-IP rate limiter. Expired client windows are reclaimed, and at most 10,000 active source addresses are tracked; new addresses fail closed with the existing 429 response when capacity is reached.

Root cause

The limiter pruned timestamps within each requesting IP's list but never removed IP keys from its process-lifetime dictionary. Source-address churn could therefore grow memory without bound even though each individual address stayed within its request budget.

Validation

  • Added coverage for client-cardinality exhaustion
  • Added coverage for expired-client reclamation
  • Focused server tests: 25 passed
  • Full clean-environment unit suite: 1052 passed, 8 skipped
  • Ruff and mypy: clean
  • Bandit: clean
  • git diff --check: clean

Documentation

  • Added the source-churn control and residual distributed-DoS risk to the threat model
  • Added an Unreleased security changelog entry

@imran-siddique
imran-siddique marked this pull request as ready for review August 11, 2026 19:01
Signed-off-by: Imran Siddique <imran.siddique@opaque.co>
@imran-siddique
imran-siddique force-pushed the agent/bound-health-rate-limiter branch from 2633f37 to a294bd8 Compare August 11, 2026 19:03
@imran-siddique
imran-siddique merged commit ddd444f into main Aug 11, 2026
11 checks passed
@imran-siddique
imran-siddique deleted the agent/bound-health-rate-limiter branch August 11, 2026 19:06
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