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
AmiServerConfig exposes auth_timeout (default 30s) and auth_limit (default 50 unauthenticated sessions), but neither is enforced anywhere. Unauthenticated AMI connections live forever and are unbounded, and Login has no failed-attempt rate-limit / backoff.
Location
crates/asterisk-ami/src/server.rs:37-39,51-52 — fields defined + defaulted.
crates/asterisk-ami/src/server.rs:212-219 — handle_connection(..., _config: AmiServerConfig): the config is received but the parameter is unused (_config). No auth deadline task, no cap on concurrent pre-auth sessions.
$ grep -rn 'auth_timeout\|auth_limit' crates/asterisk-ami/src
# only the struct fields, the defaults, and a test asserting the default — no enforcement
handle_login (actions.rs:227) has no per-source failed-attempt counter / delay.
Attack / impact
A client can open the AMI port, send the banner, and hold the connection open indefinitely without authenticating; many such connections exhaust sessions/FDs (pre-auth resource exhaustion). Related to the unbounded pre-auth read buffer in AMI: unbounded pre-auth read buffer (memory-exhaustion DoS) #110 — this is the same trust boundary (unauthenticated session lifecycle) from the timeout/limit angle.
Summary
AmiServerConfigexposesauth_timeout(default 30s) andauth_limit(default 50 unauthenticated sessions), but neither is enforced anywhere. Unauthenticated AMI connections live forever and are unbounded, andLoginhas no failed-attempt rate-limit / backoff.Location
crates/asterisk-ami/src/server.rs:37-39,51-52— fields defined + defaulted.crates/asterisk-ami/src/server.rs:212-219—handle_connection(..., _config: AmiServerConfig): the config is received but the parameter is unused (_config). No auth deadline task, no cap on concurrent pre-auth sessions.handle_login(actions.rs:227) has no per-source failed-attempt counter / delay.Attack / impact
Login(bounded only by network throughput). With the constant-time compare in PR harden(ami): constant-time credential compare + single-use MD5 challenge #123 the per-guess timing oracle is closed, but raw guess volume is still unthrottled.Recommended fix
auth_timeout: spawn a per-connection deadline that drops the socket if!authenticatedwhen it fires (cancel on successfulLogin).auth_limit: track unauthenticated session count; refuse/After-limit new connections.Logincounter with exponential backoff or temporary block (mirror the SIPrate_limit.rsapproach already in-tree).