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
{{ message }}
Repository navigation
rate limiter: the shared store's cap can be spent, so a real client is refused behind 65,536 synthetic keys #1189
Found by: the security lens in review round 6 of job 032-admin-console-parity (round-6/review-security.md, note on subject 2). Not blocking for that job — the property predates it on the wire path — filed as its own decision.
crates/nostream-relay/src/limits.rs's EwmaRateLimiter store is capped at MAX_STORE_KEYS = 65,536 and, when full, refuses the new key rather than displacing a live one (Store::admit, :120-126).
Measured (round 6): filling the store with 65,536 distinct keys took 144 ms with zero refusals during the fill; afterwards a real GET /admin/session from a different address answered 429, while a whitelisted address stayed exempt. Reachable from an IPv6 /64 (one key per address string), and the login scope's 900 s TTL makes a 15-minute hold cheap through unauthenticated POST /login. The same property already exists on the wire's connection_limited at base, so this is not a regression introduced by the admin surface — it is a design question the admin surface made easy to measure.
What a fix has to decide (a person's call, not a builder's): per-prefix bounding of keys, eviction of the oldest key when full (the ported Lua's own rule is refusal, so this diverges), or a cheaper key so the cap is unreachable in practice. Whichever is chosen needs an ADR entry and a test that fills the store and shows a real client still admitted.
Closing:Closes #N is inert on a PR targeting rewrite/main; close by hand with the merge sha.
Activity
feat(admin): serve the console's HTTP surface from the relay's one li…