Skip to content

GHSA-4jvx-93h3-f45h CVE-2026-42085 PYSEC-2026-2243

OpenC3 COSMOS allows arbitrary writes to plugins directory via path-traversed config filenames

Medium PyPIRubyGems
Severity
4.3 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
0.31%
Chance of exploitation in the next 30 days. Higher than 24.28% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-23 Relative Path Traversal
Fix
Available
2 packages have a fixed version

Description

Summary

OpenC3 COSMOS contains a design flaw in the save_tool_config() function that allows saving tool configuration files at arbitrary locations inside the shared /plugins directory tree by supplying crafted configuration filenames. Although the implementation sufficiently mitigates standard path traversal attacks, by canonicalizing filename to an absolute path, all plugins share this same root directory. That enables users to create arbitrary file structures and overwrite existing configuration files within the shared /plugins directory.

Details

In function save_tool_config() (local_mode.rb) responsible for saving user-supplied tool configuration, the desired saving directory is not sufficiently enforced, instead allowing writes inside entire OPENC3_LOCAL_MODE_PATH.

PoC

  1. Navigate to any tool that enables “Save Configuration” option in left-hand drop-down menu (here Limits Monitor as an example)
  2. Save a new config with path traversal name using “../” sequences to escape desired directory (up to 3 levels high)
  3. Observe new files created in /plugins directory by inspecting docker container directly (openc3-COSMOS-cmd-tlm-api) or using Bucket Explorer (plugin_default)

<img width="811" height="584" alt="image" src="https://github.com/user-attachments/assets/015a59b4-8b18-4801-aef0-df4831d5c1c3" /> <img width="720" height="664" alt="image" src="https://github.com/user-attachments/assets/8ca4a5b7-ee45-4c3b-99f6-f41f974a74a7" />

Impact

Modifying the data of other plugins

Affected versions

PyPI

PackageVulnerableFixed in
openc3
< 6.10.5
6.10.5

RubyGems

PackageVulnerableFixed in
openc3
< 6.10.5
6.10.5
openc3
>= 7.0.0.pre.rc1, < 7.0.0-rc3
7.0.0-rc3

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

openc3 PyPI → 6.10.5

pip
pip install --upgrade "openc3>=6.10.5"
poetry
poetry add "openc3>=6.10.5"
uv
uv add "openc3>=6.10.5"

openc3 RubyGems → 6.10.5

bundler
bundle update openc3 # Gemfile: gem "openc3", ">= 6.10.5"

Severity breakdown

CVSS 3.1 4.3

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

Weakness

CWE-23: Relative Path Traversal

The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.

How to prevent it
  • Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright. When validating filenames, use stringent allowlists that limit the character set to be used. If feasible, only allow a single "." character in the filename to avoid weaknesses such as CWE-23, and exclude directory separators such as "/" to avoid CWE-36. Use a list of allowable file extensions, which will help to avoid CWE-434. Do not rely exclusively on a filtering mechanism that removes potentially dangerous characters. This is equivalent to a denylist, which may be incomplete (CWE-184). For example, filtering "/" is insufficient protection if the filesystem also supports the use of "\" as a directory separator. Another possible error could occur when the filtering is applied in a way that still produces dangerous data (CWE-182). For example, if "../" sequences are removed from the ".../...//" string in a sequential fashion, two instances of "../" would b
  • Implementation: Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked. Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes ".." sequences and symbolic links (CWE-23, CWE-59). This includes: realpath() in C getCanonicalPath() in Java GetFullPath() in ASP.NET realpath() or abs_path() in Perl realpath() in PHP
  • Operation: Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-jjq7-m736-w977
OpenC3 COSMOS: Authenticated remote code execution via the user-writable config overlay (table definitions, cmd/tlm definitions, and script suites)
Critical Also affects openc3
GHSA-vp3w-52v9-q57f
OpenC3 COSMOS: Authenticated OS command injection via the `pypi_url` setting
High Also affects openc3
GHSA-2wvh-87g2-89hr
OpenC3 COSMOS: Permissions Bypass Provides User Access to Unassigned Administrative Actions via Script Runner Tool
High Also affects openc3
GHSA-v529-vhwc-wfc5
OpenC3 COSMOS has SQL Injection in QuestDB Time-Series Database
Critical Also affects openc3
GHSA-ffq5-qpvf-xq7x
OpenC3 COSMOS is Vulnerable to Self-XSS Through the Command Sender
Medium Also affects openc3
GHSA-wgx6-g857-jjf7
OpenC3 COSMOS: Hijacked session token can be used to reset password for persistence
High Also affects openc3
GHSA-w757-4qv9-mghp
openc3-api Vulnerable to Unauthenticated Remote Code Execution
Critical Also affects openc3
GHSA-4xqv-47rm-37mm
OpenC3 stores passwords in clear text (`GHSL-2024-129`)
Medium Also affects openc3
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor