Repository navigation
Reject non-positive SignalR sequence IDs - #69399
BrennanConroy merged 3 commits into
Conversation
|
Thanks for your PR, @Souheyl7Gouadria. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
@dotnet-policy-service agree |
|
@BrennanConroy could you review this when you have time? Two unrelated failures: the Blazor E2E test |
|
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime. |
|
There should probably be functional tests that show the connection is closed by the server and that the client closes the connection if it receives a bad sequence ID. |
The server closes the connection with an error and the .NET client closes with the exception when a SequenceMessage with a non-positive ID is received.
|
@BrennanConroy added functional tests: |
Also use RunContinuationsAsynchronously for the TaskCompletionSource in the .NET client test.
|
✅ No documentation PR was created. Confidence that documentation is needed: 10% No docs needed: internal bug fix with tests; no deterministic docs signals. Documentation surfaces considered
|
Reject non-positive SignalR sequence IDs
Validate the lower bound of a received
SequenceMessage.SequenceId.Description
With stateful reconnect,
MessageBuffer.ShouldProcessMessageonly checked that a receivedSequenceIdwasn't larger than expected. A value below 1 (for examplelong.MinValue) was accepted and stored as the current receiving ID. Every following invocation then compared as a duplicate and was dropped. The connection stayed open and kept answering pings while it discarded everything the peer sent.Sequence IDs start at 1, so a value below 1 now throws
InvalidOperationException, the same as the existing check for IDs that are too large.MessageBufferis shared source, so the check applies to both the server and the .NET client.Added a test for
0,-1andlong.MinValue. It fails without the fix.Fixes #69283