Authenticated OS Command Injection in OpenC3 COSMOS
Authenticated users can achieve arbitrary OS command execution in the OpenC3 COSMOS API via shell metacharacter injection in the pypi_url configuration setting during plugin installation.
CVE search metadata
CVE search record: CVE-2026-77601. Severity: high. CVSS: 8.8. KEV: no. Product: openc3 (>= 5.12.0, <= 7.2.1). Brief: Authenticated OS Command Injection in OpenC3 COSMOS. Brief link: https://feed.craftedsignal.io/briefs/2026-09-openc3-rce/
OpenC3 COSMOS, specifically the openc3-cosmos-cmd-tlm-api service, is vulnerable to authenticated OS command injection via the pypi_url setting. An attacker can use the JSON-RPC method set_setting to update this configuration with a string containing shell metacharacters. During the plugin installation process, the application incorrectly uses Ruby backticks to invoke /openc3/bin/pipinstall, passing the unsanitized pypi_url directly to /bin/sh. This behavior impacts OpenC3 versions 5.12.0 through 7.2.1. In the open-source edition, the vulnerability is accessible to any authenticated user due to improper authorization checks in openc3/lib/openc3/utilities/authorization.rb. Successful exploitation results in command execution as the openc3 service user (uid 1001) within the application container, granting access to sensitive credentials, Redis/Valkey secrets, and bucket storage.
Attack Chain
- Attacker authenticates to the
POST /openc3-api/auth/verifyendpoint to obtain a valid session token. - Attacker invokes the
set_settingJSON-RPC method viaPOST /openc3-api/apito set thepypi_urlparameter to a malicious payload (e.g.,https://pypi.org ; <command> ; #). - Attacker prepares a malicious plugin gem containing a
requirements.txtorpyproject.tomlfile to trigger the Python installation logic. - Attacker uploads the malicious plugin via
POST /openc3-api/plugins. - Attacker triggers the plugin installation using the hash obtained from the upload via
POST /openc3-api/plugins/install/<id>. - The
openc3/lib/openc3/models/plugin_model.rbscript executes the injected payload through the Ruby backtick operator, which spawns/bin/sh -c. - The operating system executes the malicious command with the privileges of the
openc3service user.
Impact
Successful exploitation allows for full control of the openc3 service account inside the container. This leads to the exfiltration or modification of telemetry and commanding data, compromise of cloud storage (S3) credentials, and access to internal Redis/Valkey configuration passwords. This vulnerability enables lateral movement or deeper persistence within the scope of the affected container.
Recommendation
- Upgrade OpenC3 to a patched version once available; monitor vendor security advisories for the specific release addressing CVE-2026-77601.
- Apply the code-level mitigation by replacing the Ruby backtick execution in
plugin_model.rbwith anOpenC3::ProcessManager.spawncall using an argument array to prevent shell interpretation. - Implement input validation on the
pypi_urlsetting to restrict values to legitimate HTTP or HTTPS URLs. - Review audit logs for anomalous
set_settingcalls involving JSON-RPC where the parameter values contain shell metacharacters like;,&,|, or backticks.
Immediate actions
Monitor API logs for set_setting calls containing shell metacharacters in the pypi_url field
Mitigations
Upgrade to patched release or implement code-level sanitization using ProcessManager.spawn as described in the brief
CVE-2026-77601