Skip to content

Security fix: pause cycling connection-slot squatting DoS - #210

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/application-security-review-4312
Draft

Security fix: pause cycling connection-slot squatting DoS#210
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/application-security-review-4312

Conversation

@cursor

@cursor cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Security review finding (Medium)

Issue: #209

Location: src/session/conn.rs

Impact: Unauthenticated RTMP peers can hold server connection slots indefinitely by cycling pause/unpause on a playing session that never receives relay media. With max_connections set, this exhausts available slots and denies legitimate clients.

Root cause: The pause handler unconditionally resets session_setup_started, refreshing the 10-second setup-timeout window on every transition into paused state. An attacker alternates pause(false) and pause(true) every few seconds to prevent session_setup_timed_out() from ever firing.

Fix: Only refresh session_setup_started on pause when media_bytes_sent > 0, preserving the grace window for viewers that are actually receiving relay while blocking timer reset for squatters.

Includes regression tests for both the attack path and legitimate paused viewers.

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.

Players that never received outbound relay must not refresh
session_setup_started on pause. Otherwise an attacker can cycle
pause/unpause every few seconds to hold connection slots indefinitely
without consuming media.

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