CAI-8466: fix(calling): sec-vulnerabilities part 1 — validate makeCall dest, WSS frame guard, keepalive timeout - #5180
Draft
mkesavan13 wants to merge 1 commit into
Draft
Conversation
…l dest, WSS frame guard, keepalive timeout Jira: https://jira-eng-gpk2.cisco.com/jira/browse/CAI-8466 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
COMPLETES https://jira-eng-gpk2.cisco.com/jira/browse/CAI-8466
This pull request addresses
Three security vulnerabilities in the
@webex/callingpackage:VALID_PHONE_REGEXlacked start/end anchors, so partial matches let malformed destination strings pass validation.Socket.onmessageblindly castJSON.parseoutput toSocketResponsewithout validating the shape, allowing primitives and arrays to be processed as call-control frames.keepaliveInFlightif a keepalive response was never received, causing the keepalive mechanism to stall permanently.by making the following changes
MAKE_CALL_PHONE_REGEX(/^[\d\s()*#+.-]+$/) with^/$anchors so the entire destination address must match; simplified sanitizer inmakeCallto strip anything not in[+*#\d].isSocketResponsefunction insocket/types.ts;onmessagenow calls it before processing and drops (with a warning) any frame that is not a plain non-null object.keepaliveInFlightTimeoutinwebWorker.ts: set when a keepalive is dispatched, cleared onKEEPALIVE_RESULTorCLEAR_KEEPALIVE, and fires afterinterval × 2seconds to resetkeepaliveInFlightand unblock future keepalives.Change Type
The following scenarios were tested
yarn workspace @webex/calling compilecompleted successfully (25+ packages built).yarn workspace @webex/calling test:unit— 859 tests passed across 31 suites (includingline.test.ts,socket.test.ts,webWorker.test.ts).Testing
yarn workspace @webex/calling compile— all 25 dependency packages and calling built successfully.yarn workspace @webex/calling test:unit— 859/859 tests passed, 31/31 suites.Acceptance Criteria
makeCallrejects destination addresses that only partially match the phone regex.line.test.tsfor partial-match and full-match cases passed in Gate 2.socket.test.tsfor primitive and array frames passed in Gate 2.interval × 2seconds if no response arrives.webWorker.test.tsfor timeout path passed in Gate 2.Contract Discovery Warnings
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Jira: https://jira-eng-gpk2.cisco.com/jira/browse/CAI-8466