|
| 1 | +--- |
| 2 | +gem: openc3 |
| 3 | +cve: 2026-77602 |
| 4 | +ghsa: jjq7-m736-w977 |
| 5 | +url: https://nvd.nist.gov/vuln/detail/CVE-2026-77602 |
| 6 | +title: OpenC3 COSMOS - Authenticated remote code execution via |
| 7 | + the user-writable config overlay (table definitions, cmd/tlm |
| 8 | + definitions, and script suites) |
| 9 | +date: 2026-07-11 |
| 10 | +description: | |
| 11 | + ## Summary |
| 12 | +
|
| 13 | + COSMOS reads configuration from a user-writable overlay (`targets_modified/`) |
| 14 | + before the read-only plugin-installed `targets/` tree, and the config |
| 15 | + subsystem executes code on those files: `ConfigParser` renders every |
| 16 | + file as ERB by default, a `GENERIC_READ_CONVERSION` / |
| 17 | + `GENERIC_WRITE_CONVERSION` block is evaluated as code by |
| 18 | + `GenericConversion` (Ruby and Python), and the Script Runner suite |
| 19 | + analysis `require`s a procedure file. An authenticated user can write |
| 20 | + into `targets_modified/` below the admin tier (the storage-upload |
| 21 | + endpoint exempts that area from the admin gate, and the screen-save |
| 22 | + endpoint stores its body verbatim there), so the same root cause is |
| 23 | + reachable through several features, each giving arbitrary code |
| 24 | + execution on a COSMOS server. |
| 25 | +
|
| 26 | + Three vulnerable routes were identified, all reachable by an |
| 27 | + authenticated non-admin user (in the open-source edition `authorize` |
| 28 | + ignores the permission string, so any authenticated user qualifies): |
| 29 | +
|
| 30 | + 1. **Table definitions** (immediate). `tables#generate|report|load` |
| 31 | + reads a definition from `targets_modified/` and ERB-renders it |
| 32 | + and evaluates its `GENERIC_*_CONVERSION` block in the |
| 33 | + `cmd-tlm-api` container. |
| 34 | +
|
| 35 | + 2. **Command/telemetry definitions** (persistent). A file written |
| 36 | + to `targets_modified/<TARGET>/cmd_tlm/` is overlaid by |
| 37 | + `System.setup_targets` and processed by `PacketConfig` in the |
| 38 | + decom/multi microservices: ERB-rendered in the Ruby implementation, |
| 39 | + and GENERIC-evaluated in both the Ruby and Python implementations |
| 40 | + (the Python `ConfigParser` does not run ERB). It executes on |
| 41 | + the next microservice (re)start. |
| 42 | +
|
| 43 | + 3. **Script Runner suites** (immediate). A procedure written to |
| 44 | + `targets_modified/<TARGET>/procedures/` is `require`d by the |
| 45 | + suite analysis, reachable at the read-only `script_view` tier |
| 46 | + through `scripts#body` and `running_script#show` (the analysis |
| 47 | + subprocess is spawned when `OPENC3_SERVICE_PASSWORD` is |
| 48 | + configured, which it is in the shipped `.env`). |
| 49 | +
|
| 50 | + ### Impact |
| 51 | +
|
| 52 | + Arbitrary code execution as the `openc3` user in the `cmd-tlm-api` |
| 53 | + container and the per-target decom microservices and the script-runner. |
| 54 | + Those processes hold the Redis and bucket credentials and sit on the |
| 55 | + internal service network, so the executed code acts with that authority |
| 56 | + over configuration, telemetry, and command data across scopes. The |
| 57 | + API is served through Traefik, which the shipped compose binds to |
| 58 | + `127.0.0.1:2900`, so a default single-host install is reachable only |
| 59 | + from the host; a multi-user deployment exposes the web port, and the |
| 60 | + `AV:N` rating reflects that standard remote-operator exposure. |
| 61 | +
|
| 62 | + All paths require valid authentication, and the triggering permissions |
| 63 | + (`system`/`system_set`/`script_view`) are below the `admin`/`script_run`/ |
| 64 | + lugin-install tiers where COSMOS gates code execution. In the |
| 65 | + open-source edition `authorize` checks only token validity and does |
| 66 | + not enforce the permission string, so any authenticated user can |
| 67 | + perform these requests. |
| 68 | +cvss_v3: 9.9 |
| 69 | +unaffected_versions: |
| 70 | + - "< 5.1.0" |
| 71 | +patched_versions: |
| 72 | + - ">= 7.2.1" |
| 73 | +related: |
| 74 | + url: |
| 75 | + - https://nvd.nist.gov/vuln/detail/CVE-2026-77602 |
| 76 | + - https://rubygems.org/gems/openc3/versions/7.2.1 |
| 77 | + - https://github.com/OpenC3/cosmos/releases/tag/v7.2.1 |
| 78 | + - https://github.com/OpenC3/cosmos/pull/3488 |
| 79 | + - https://github.com/OpenC3/cosmos/commit/71943352a28128ef3e7e894319d97a656b5cd4f2 |
| 80 | + - https://github.com/OpenC3/cosmos/commit/7a1538a4626f82c0d1540fcaa27ffdcbbd71ff81 |
| 81 | + - https://advisories.gitlab.com/gem/openc3/CVE-2026-77602 |
| 82 | + - https://osv.dev/vulnerability/GHSA-jjq7-m736-w977 |
| 83 | + - https://github.com/OpenC3/cosmos/security/advisories/GHSA-jjq7-m736-w977 |
| 84 | + - https://github.com/advisories/GHSA-jjq7-m736-w977 |
| 85 | +notes: | |
| 86 | + - cvss_v3 in GHSA and nvd.nist.gov URLs. |
| 87 | + - date from rubygems.org URL |
| 88 | + - Found PR#3488 in release 7.2.1 release notes so changed patched_versions. |
0 commit comments