Repository navigation
Conversation
hkrutzer
force-pushed
the
hkr/fix-sip-ua-handle-crossed-bye-tkmukrpoyzyp
branch
from
September 9, 2026 19:48
ab645f1 to
0965d24
Compare
hkrutzer
force-pushed
the
hkr/fix-sip-ua-handle-crossed-bye-tkmukrpoyzyp
branch
2 times, most recently
from
October 28, 2026 19:34
61e90d4 to
e03d0da
Compare
Fixes RUSTSEC-2026-0387
hkrutzer
force-pushed
the
hkr/fix-sip-ua-handle-crossed-bye-tkmukrpoyzyp
branch
from
October 28, 2026 21:47
e03d0da to
b6e47c3
Compare
- terminate() held the session state lock until our BYE received a final response. The incoming BYE needs that lock, so it could not be answered in the meantime. - Once the session was terminated, an incoming BYE was ignored and fell through to the dialog layer, which answered it with 404 Not Found.
A caller can send BYE after receiving a provisional INVITE response, before we have accepted the call. In this case we send two separate responses: 200 OK for the BYE, and 487 Request Terminated for the pending INVITE. The 200 OK was built from the INVITE instead of the BYE. It therefore carried the INVITE's Via branch and CSeq. The peer saw it as a response to the INVITE, not the BYE. Its BYE could time out, while its INVITE appeared to receive both a success and a failure response. Build the 200 OK from the BYE so each response answers the right request.
A BYE that crossed ours could arrive after the application dropped the InviteSession (e.g. via Call::terminate) while our BYE client transaction was still in its Completed state. The dialog and INVITE usage were already gone, so the crossed BYE got 481. terminate() now retains the usage guard and dialog for T4 after a final response over UDP, matching the transaction lifetime. This follows the RFC 5407 Mortal state, in which a crossed BYE is answered with 200 OK (§3.2.1 notes an error response is also acceptable).
hkrutzer
force-pushed
the
hkr/fix-sip-ua-handle-crossed-bye-tkmukrpoyzyp
branch
from
October 31, 2026 13:49
b6e47c3 to
7bc4cd7
Compare
hkrutzer
marked this pull request as ready for review
October 31, 2026 14:06
Contributor
Author
|
@kbalt please take a look when you have time. This should resolve most issues around crossed BYEs, there is one that remains that I'm aware of, that can happen when the session event queue is full, that I haven't solved yet. |
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.
See #70