Fix hanging sessions for unauthorized connections#470
Merged
Conversation
When authentication is required but no token is provided, or when a session has no permissions at all, properly reject the connection instead of hanging during the MoQ handshake phase. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Claude finished @kixelated's task —— View job Code Review - Security & Bug Analysis
Analysis SummaryThe fix addresses the hanging session issue by adding two validation checks in
Security Assessment ✅No security issues found. The changes improve security posture by:
Bug Analysis ✅No bugs identified. The implementation is sound:
Code QualityThe fix is minimal, targeted, and maintains consistency with the existing codebase patterns. Error messages are appropriately descriptive without revealing sensitive details. Recommendation: Approve - This is a clean fix that resolves the hanging session issue without introducing security vulnerabilities or bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
When connecting to a path that requires authentication (like
hang/roombefore it was configured as public), sessions would hang indefinitely during the MoQ handshake instead of being properly rejected with an authorization error.Root Cause
The issue was in
rs/moq-relay/src/auth.rswhere the validation logic would create a "dummy token" with no permissions for unauthorized connections, but then allow those connections to proceed to the MoQ session establishment phase. The server would then hang waiting for the client to initiate the MoQ handshake.Solution
Test plan
just checkto verify all tests pass🤖 Generated with Claude Code