/

CVE-2026-77394

Severity:

HIGH RISK

(7.6)

Stored XSS (CWE-79) in OpenC3 COSMOS Shared Screens

CVE-2026-77394

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Session Token Theft and Account Takeover

Severity:

HIGH RISK

(7.6)

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

OpenC3 COSMOS contains a stored cross-site scripting vulnerability in shared screen button actions, allowing an authenticated user with system_set permission to store script content that executes in another operator's browser session. When activated, the script may read the victim's bearer token from local storage, potentially enabling account takeover and actions with the victim's privileges.

Affected context

The issue occurs in COSMOS deployments using shared screens and the BUTTON widget. It becomes risky when an authenticated actor has system_set permission, can create or modify shared screen content, and another operator views and activates the affected button in a browser session. The permissive content security policy may make script execution easier, but unsafe handling of stored widget actions is the primary concern.

Exploit preconditions

  • Attack surface: The shared-screen API and browser-based COSMOS operator interface
  • Required access: An authenticated account with system_set permission
  • Trigger point: A victim activates a stored BUTTON widget in another operator's browser session
  • Required victim condition: The victim must access the affected shared screen and interact with the button
  • Why exploitation is possible: Stored widget action content is evaluated in the COSMOS origin without sufficiently separating data from executable browser code

Why this happens

The vulnerability is caused by treating stored BUTTON widget actions as executable content in an operator's browser context. This permits attacker-controlled data persisted through the shared-screen feature to execute with the privileges and origin of the viewing session. The behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting. Access to browser storage containing bearer tokens increases the impact, while the content security policy is a contributing control weakness rather than the primary root cause.

Potential impact

  • An attacker may execute JavaScript in another operator's COSMOS origin
  • A victim's bearer token could be exposed
  • The attacker could take over the victim's account or session
  • Actions could be performed with the victim's permissions
  • Operational data or embedded-system commands could be accessed or affected

General mitigation guidance

Mitigation generally focuses on ensuring that stored screen configuration remains data rather than executable browser code.

Common defensive patterns include:

  • Rendering widget actions through strict allowlisted commands instead of evaluating arbitrary script content
  • Applying context-aware output encoding and sanitization before displaying persisted values
  • Validating shared-screen schemas on the server and rejecting unexpected action types or fields
  • Reducing the ability of broad-privilege accounts to create or modify shared screens
  • Protecting bearer tokens from browser-readable storage where practical and using narrowly scoped, short-lived credentials
  • Enforcing a restrictive, nonce- or hash-based content security policy as defense in depth
  • Applying least privilege to operator accounts and separating screen-authoring permissions from operational control permissions

How teams detect issues like this

Detection approaches may include:

  • Static analysis rules for DOM sinks, JavaScript evaluation, and dynamic compilation in widget components
  • Code review checks for persisted values reaching HTML, script, event-handler, or template execution contexts
  • Server-side policy checks that restrict shared-screen actions to a documented allowlist
  • Runtime monitoring for unusual shared-screen creation or modification by privileged accounts
  • Browser security telemetry for unexpected script execution or token-access behavior
  • Automated security review tools that identify stored XSS data flows and overly permissive content security policies

Sources

SourceLink
github.comgithub.com/OpenC3/cosmos/commit/10371f8f410b9ad588f98dfa3befaaacb6587cd3
github.comgithub.com/OpenC3/cosmos/pull/3560
github.comgithub.com/OpenC3/cosmos/releases/tag/v7.3.0
github.comgithub.com/OpenC3/cosmos/security/advisories/GHSA-gvf2-2rh5-mpgf

Frequently asked

questions

It can be exploitable through the COSMOS web application when an authenticated user with system_set permission can create or modify shared screens and another operator activates the affected widget.

No. The attacker generally needs the specified authenticated permission, while the victim only needs to view and activate the shared screen in a browser session.

Do not evaluate stored widget actions as arbitrary browser code. Use strictly allowlisted, parameterized commands, enforce server-side validation, and apply context-aware output encoding.

Treat persisted UI configuration as untrusted input, minimize browser-readable secrets, restrict screen-authoring privileges, and use restrictive browser security policies as defense in depth.

Find out what's already
exploitable in your codebase.