/

CVE-2026-26862

Severity:

HIGH RISK

(8.3)

XSS in CleverTap Web SDK Visual Builder postMessage Origin

CVE-2026-26862

Analyzed

Vulnerability type

Category:

Cross-Site Scripting (XSS)

CWE:

CWE-79, CWE-829

Impact:

Client-Side Code Execution / Session Compromise

Severity:

HIGH RISK

(8.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

CleverTap Web SDK versions 1.15.2 and earlier contain a DOM-based Cross-Site Scripting vulnerability in the Visual Builder module, where messages received via window.postMessage are insufficiently validated.

Because the origin check uses includes("dashboard.clevertap.com"), an attacker controlling a crafted subdomain can bypass the validation and inject script into pages embedding the SDK, potentially running arbitrary JavaScript in the victim's browser.

Affected context

This vulnerability occurs in web applications that embed the CleverTap Web SDK (version 1.15.2 and earlier) and enable or load the Visual Builder functionality.

The affected code path is in src/modules/visualBuilder/pageBuilder.js, where messages sent via window.postMessage from CleverTap's dashboard are handled.

The risk is present when:

  • A page loads the vulnerable SDK.
  • The Visual Builder module is initialized or reachable in the runtime.
  • The application expects postMessage traffic from dashboard.clevertap.com but relies solely on substring-based origin checks.

Exploit preconditions

  • Attack surface: Browser-based, through any page that includes the vulnerable CleverTap Web SDK with Visual Builder enabled or loaded.
  • Required access: Ability to get a victim to visit or interact with a page while the attacker's crafted origin can send postMessage calls to the embedded page (e.g., via malicious iframe, popup, or controlled site).
  • Trigger point: The Visual Builder's postMessage handler in pageBuilder.js receives and processes messages where the origin passes a weak validation check based on includes("dashboard.clevertap.com").
  • Why exploitation is possible: The origin validation logic treats any origin string containing dashboard.clevertap.com as trusted, which can be trivially spoofed by subdomains or domains like https://dashboard.clevertap.com.evil.com. Incoming message data is then handled as trusted input in the DOM, enabling DOM-based XSS.

Why this happens

The underlying issue is a flawed trust decision in client-side message handling, mapping to CWE-79 (Improper Neutralization of Input During Web Page Generation) and related trust boundary problems captured by CWE-829 (Inclusion of Functionality from Untrusted Control Sphere).

Specifically:

  • The Visual Builder's postMessage handler uses origin.includes("dashboard.clevertap.com") instead of a strict, exact comparison against an expected origin.
  • This substring-based check allows untrusted domains that merely contain the trusted string to be treated as legitimate.
  • Once incorrectly trusted, data from the attacker-controlled message can be used in DOM updates or script-related logic without robust sanitization, resulting in DOM-based XSS in the context of the embedding site.

Potential impact

  • Execution of arbitrary JavaScript in the victim's browser within the origin of the affected website.
  • Theft or misuse of session cookies, tokens, or other web storage items accessible to the page.
  • Unauthorized actions on behalf of the user within the affected application (e.g., clicking, form submission, API calls).
  • Manipulation of page content, including defacement, deceptive UI overlays, or exfiltration of sensitive data displayed in the DOM.
  • Use of the compromised page as a pivot for further client-side attacks (e.g., phishing flows, credential harvesting).

General mitigation guidance

Effective mitigation focuses on enforcing strict origin validation and hardening client-side message handling patterns:

  • Replace substring-based checks (includes, indexOf, regex lax patterns) with strict, exact origin comparisons (e.g., equality checks against a whitelist of fully qualified, expected origins).
  • Maintain a normalized allowlist of permitted origins for postMessage handlers, validating the full origin value (scheme, host, and port).
  • Treat all message data as untrusted input: validate structure and type, and apply output encoding before injecting into the DOM or using in any script-related context.
  • Isolate high-privilege or configuration-related messaging logic into narrowly scoped modules, minimizing the data and operations available via cross-origin messages.
  • Apply the principle of least privilege client-side: avoid granting postMessage handlers the ability to arbitrarily modify the page or execute arbitrary scripts.

How teams detect issues like this

Organizations can detect this class of issue by combining static review of SDK code and runtime monitoring:

  • Static analysis: Configure rules to flag:
  • Use of window.postMessage handlers that rely on substring-based origin checking (e.g., .includes, .indexOf) instead of exact matching.
  • Any message-handling logic that writes directly to the DOM (e.g., innerHTML, document.write, dangerous templating) using data from cross-origin messages.
  • Code review: During manual review of front-end code and third-party SDK integrations:
  • Verify all postMessage handlers perform strict equality checks against a finite, documented origin allowlist.
  • Trace how message data flows into DOM APIs, templating, or eval-like constructs.
  • Policy enforcement: Use security linters or CI gates to:
  • Enforce secure origin validation patterns.
  • Disallow direct DOM sinks from cross-origin data without explicit sanitization.
  • Runtime monitoring: Employ Content Security Policy (CSP) to reduce impact of XSS, and browser-based security tooling to flag suspicious inline script execution paths.

Sources

SourceLink
github.comgithub.com/CleverTap/clevertap-web-sdk/blob/cf1b65d/src/modules/visualBuilder/pageBuilder.js#L56-L60
github.comgithub.com/CleverTap/clevertap-web-sdk/issues/442
github.comgithub.com/CleverTap/clevertap-web-sdk/pull/417

Frequently asked

questions

Yes. An attacker can exploit it remotely by hosting a malicious page on a crafted domain that passes the weak origin check and then causing a victim to load a site that includes the vulnerable CleverTap Web SDK with Visual Builder active.

Not necessarily. The core requirement is the ability to send crafted postMessage calls from a controlled origin that passes the SDK's origin filter, and to get users to load the affected site. Application-level authentication may affect what data can be accessed or actions performed, but is not required to trigger the XSS itself.

Implement strict origin checking for all postMessage handlers using equality against a well-defined list of allowed origins, and validate and sanitize all message payloads before touching the DOM or executing any logic that can affect security-sensitive state.

Establish coding standards that:

  • Require exact origin comparison for cross-window messaging.
  • Treat all cross-origin data as untrusted and subject to validation and output encoding.
  • Prohibit high-risk DOM APIs and dynamic script creation driven by untrusted input.
  • Integrate automated checks (linters, SAST, code review checklists) specifically targeting postMessage usage and DOM-based XSS patterns.
Find out what's already
exploitable in your codebase.