fix(sip): raise header value cap to 4 KB for carrier tokens like X-Twilio-CallToken - #1750
Open
rkfshakti wants to merge 1 commit into
Open
fix(sip): raise header value cap to 4 KB for carrier tokens like X-Twilio-CallToken#1750rkfshakti wants to merge 1 commit into
rkfshakti wants to merge 1 commit into
Conversation
…ilio-CallToken Twilio's Immutable Call Forwarding flow requires X-Twilio-CallToken to be forwarded unchanged on the outbound leg. The token is opaque and carries SHAKEN/STIR + DIV PASSporTs, so it routinely exceeds the current 1024-byte cap and CreateSIPParticipant rejects the request with 'invalid header value for X-Twilio-CallToken: value too long (max 1024 characters)' before the INVITE is ever sent. RFC 3261 §7.1 bounds the message (8 KB datagram on UDP), not individual header values. 4096 keeps a single header from dominating a datagram while tolerating real carrier tokens; the character-set validation is unchanged. Fixes livekit#789
🦋 Changeset detectedLatest commit: 439a424 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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
CreateSIPParticipantrejects valid TwilioX-Twilio-CallTokenvalues over 1,024 bytes:Twilio's Immutable Call Forwarding flow requires this token to be forwarded unchanged on the outbound leg so the original caller ID can be presented. The token is opaque and may contain SHAKEN/STIR and DIV PASSporTs, so truncating it is not valid either.
Root cause
ValidateHeaderValueResultcaps every header value at 1,024 characters. RFC 3261 does not bound individual header values — §7.1 bounds the whole message (8 KB datagram over UDP, larger over TCP). The 1 KB figure is this codebase's own policy and sits below the size real carrier tokens reach.Fix
maxHeaderValueLength = 4096and reject values above it. 4 KB keeps a single header from dominating an 8 KB datagram while tolerating real-world carrier tokens. Character-set validation is unchanged.Fixes #789