fix(calling): neutralize SCIM filter injection and restrict Mobius WSS hosts (CAI-8461) - #5175
Draft
mkesavan13 wants to merge 1 commit into
Draft
fix(calling): neutralize SCIM filter injection and restrict Mobius WSS hosts (CAI-8461)#5175mkesavan13 wants to merge 1 commit into
mkesavan13 wants to merge 1 commit into
Conversation
…S hosts (CAI-8461) Jira: https://jira-eng-sjc12.cisco.com/jira/browse/CAI-8461 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
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-sjc12.cisco.com/jira/browse/CAI-8461
This pull request addresses
Three P0 security findings in
@webex/calling:externalId(CallerId/index.ts:103-122): attacker-controlled value from a SIP header was interpolated raw intoid eq "..."filter expressions, allowing injection of arbitrary SCIM filter clauses.userExternalId(Utils.ts:1552-1565): same pattern inresolveContact— thecallingPartyInfo.userExternalIdfield was interpolated without escaping.Utils.ts:139-223,socket-base.ts:238-317): discovery-provided WSS URIs were trusted as socket destinations without validation, enabling a malicious discovery response to exfiltrate the Mobius bearer token to an arbitrary host.Root cause: Attacker-influenceable identifiers were interpolated raw into SCIM filter expressions, and discovery-provided WSS hosts were trusted as socket destinations without an allowlist. The existing
encodeURIComponent(filter)transport-layer encoding does not prevent SCIM filter grammar injection; a value-layer escape is required. No host validation existed before token transmission over WebSocket.by making the following changes
packages/calling/src/common/constants.ts— AddedMOBIUS_WSS_ALLOWED_DOMAINSallowlist (webex.com,wbx2.com,webexapis.com,cisco.com)packages/calling/src/common/Utils.ts— AddedescapeScimFilterValuehelper (escapes\then"); applied toresolveContactuserExternalId; added host-allowlist filterisTrustedMobiusWssHosttofilterMobiusUrisdropping non-allowlisted WSS URIspackages/calling/src/CallingClient/calling/CallerId/index.ts— AppliedescapeScimFilterValueto SIPexternalIdbefore SCIM filter interpolation inparseRemotePartyInfopackages/calling/src/mobius-socket/socket/socket-base.ts— Added pre-WebSocket host allowlist gate inopen()— rejects with typedConnectionErrorbeforeauthorize(token)runspackages/calling/src/common/Utils.test.ts— Added UT-1 (resolveContactinjection) and UT-4 (filterMobiusUrisuntrusted host); updated existing testspackages/calling/src/CallingClient/calling/CallerId/index.test.ts— Added UT-2 (parseRemotePartyInfoinjection)packages/calling/src/mobius-socket/socket.test.ts— Added UT-3 (socket.open non-allowlisted rejection + allowlisted acceptance)packages/calling/jest.config.js— Updated Jest module name mapper to use new stub mockspackages/calling/package.json— Added pre-build of@webex/legacy-toolsto resolve compile dependencypackages/calling/test/mocks/— Addedinternal-plugin-metrics-stub.js,webex-core-stub.js,empty-stub.jsfor isolated unit test executionpackages/calling/ai-docs/— UpdatedSECURITY.md,GETTING_STARTED.md,caller-id-spec.md,mobius-socket-spec.mdto document the new controlsChange Type
The following scenarios were tested
yarn workspace @webex/calling build:srccompiled successfullyyarn workspace @webex/calling test:unit857/857 tests passedTargeted test results (4 new security-focused suites):
Acceptance Criteria
id eq "...", so injected filter clauses (e.g. a value containing a double-quote) are neutralized while legitimate identifiers still resolve.escapeScimFilterValueapplied atCallerId/index.ts:116andUtils.ts:1600-1603; UT-1 and UT-2 confirmed passing in Gate 2MOBIUS_WSS_ALLOWED_DOMAINSconstant +isTrustedMobiusWssHost+filterMobiusUrisdrop +socket-base.tspre-connect guard; UT-3 and UT-4 confirmed passing in Gate 2Contract Discovery Warnings
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Jira: https://jira-eng-sjc12.cisco.com/jira/browse/CAI-8461