SECURITY: per-identity gateway rate limiting is unreachable (ratelimit) #1110

Closed
opened 2026-10-27 13:39:03 +00:00 by sam · 0 comments
Owner

Found by the reachability audit: internal/ratelimit (494 LOC) is in no shipped binary and has zero consumers -- verified by both go list -deps ./cmd/... and by grep for any importer.

The package's own doc comment states its purpose:

Package ratelimit provides a sliding-window request limiter, keyed by
platform and user, for gating inbound gateway traffic per identity rather
than globally.

So this is not unused scaffolding: it is designed per-identity inbound rate limiting that does not exist in practice. Multi-identity deployments are supported (deployments/multi-forge-github-gitea.toml), and the daemon accepts inbound traffic from several platform adapters, with no per-identity request budget on any of them.

Reads as implemented to anyone auditing the tree for rate limiting.

Provenance: added 2026-07-27 in f73b2d1 (broad in-flight epic work), last touched 2026-08-15 in 5e22981 (window-based stale-entry eviction). The eviction work landed for a limiter nothing drives.

Acceptance:

  • Either wire Limiter into the inbound gateway/channel path with a configured budget, and drive EvictStale on a ticker as the package documents, or
  • delete the package, if per-identity throttling is not wanted.

Do not leave it in its current state: shipped-but-inert security code is worse than absent code.

Close reason

Wired: Message.SenderID + Router.Limiter (checkRateLimit) in Route/RouteStream, opt-in [chat.rate_limit] config, EvictStale driven on a ticker in bootstrap.startRateLimiter. Commit 5c9f5fe.


Imported from beads archie-core-6wxb · GitHub #797 · type bug · priority P1 · created 2026-09-12 · closed 2026-09-14

Found by the reachability audit: internal/ratelimit (494 LOC) is in no shipped binary and has zero consumers -- verified by both `go list -deps ./cmd/...` and by grep for any importer. The package's own doc comment states its purpose: Package ratelimit provides a sliding-window request limiter, keyed by platform and user, for gating inbound gateway traffic per identity rather than globally. So this is not unused scaffolding: it is designed per-identity inbound rate limiting that does not exist in practice. Multi-identity deployments are supported (deployments/multi-forge-github-gitea.toml), and the daemon accepts inbound traffic from several platform adapters, with no per-identity request budget on any of them. Reads as implemented to anyone auditing the tree for rate limiting. Provenance: added 2026-07-27 in f73b2d1 (broad in-flight epic work), last touched 2026-08-15 in 5e22981 (window-based stale-entry eviction). The eviction work landed for a limiter nothing drives. Acceptance: - Either wire Limiter into the inbound gateway/channel path with a configured budget, and drive EvictStale on a ticker as the package documents, or - delete the package, if per-identity throttling is not wanted. Do not leave it in its current state: shipped-but-inert security code is worse than absent code. ### Close reason Wired: Message.SenderID + Router.Limiter (checkRateLimit) in Route/RouteStream, opt-in [chat.rate_limit] config, EvictStale driven on a ticker in bootstrap.startRateLimiter. Commit 5c9f5fe. --- _Imported from beads `archie-core-6wxb` · GitHub #797 · type bug · priority P1 · created 2026-09-12 · closed 2026-09-14_
sam added the highbug labels 2026-10-27 13:39:03 +00:00
sam self-assigned this 2026-10-27 13:39:03 +00:00
sam closed this issue 2026-10-27 13:39:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#1110