Skip to content

Improve RTSP server authentication handling and auditing#1522

Merged
AlexxIT merged 3 commits intoAlexxIT:masterfrom
subbyte:authlog
Feb 18, 2025
Merged

Improve RTSP server authentication handling and auditing#1522
AlexxIT merged 3 commits intoAlexxIT:masterfrom
subbyte:authlog

Conversation

@subbyte
Copy link
Contributor

@subbyte subbyte commented Dec 25, 2024

In the latest version (v1.9.7), when using the RTSP module/server, a client fails authentication silently, which makes it very vulnerable to RTSP brute force attack:

  • There is no log of failed RTSP authentication
  • An attacker can test multiple RTSP requests with different credentials in a single TCP connection

This RP adds "failed auth" logging for rtsp server. In addition, the PR prevents an attacker packs many brute force authentication attempts into one TCP connection. After one authentication failed, the TCP connection will terminate, forcing the attacker to start a new TCP connection for the next brute force attempt, which makes it possible to be identified and blocked by a firewall like pf.

Note ffmpeg and ffmpeg-based players, e.g., mpv, have a special authentication behavior---even if username/password is provided in the URL, the first request does not include it, resulting in a failed authentication, while all subsequent requests (in the same TCP connection) add the authentication field in the header, resulting in successful authentications.

@subbyte subbyte changed the title Add authentication logging for RTSP server Add fail authentication logging for RTSP server Dec 25, 2024
@subbyte subbyte changed the title Add fail authentication logging for RTSP server Improve RTSP server authentication handling and auditing Dec 25, 2024
@AlexxIT AlexxIT self-assigned this Dec 26, 2024
@AlexxIT AlexxIT merged commit b3f83fd into AlexxIT:master Feb 18, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Feb 18, 2025

Thanks!

@AlexxIT AlexxIT added this to the v1.9.9 milestone Feb 18, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Mar 10, 2025

57Darling02 pushed a commit to 57Darling02/go2nvr that referenced this pull request Feb 17, 2026
Improve RTSP server authentication handling and auditing
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.

3 participants