The vulnerability is a remote code execution flaw in OpenC3 COSMOS, identified as CVE-2026-77602. The root cause is that the system reads configuration from a user-writable directory (targets_modified/) before the read-only system directory (targets/). This allows an authenticated but non-admin user to upload malicious configuration files that are then executed by the server. The analysis of the provided patches confirms this and identifies several vulnerable functions that contribute to the exploit chain.
The primary vulnerable function is OpenC3::Utilities::TargetFile.body (and its Python equivalent), which is responsible for reading files from the overlay directory. Several other functions in different controllers and models use this function to read configuration, scripts, or table definitions, which then get executed. The patches address the vulnerability by modifying these functions to either enforce stricter authorization checks or to force reading from the read-only directory for sensitive operations.
The identified vulnerable functions are entry points for attackers to either write malicious files to the system or to trigger the execution of already uploaded files. These functions would appear in a runtime profile during the exploitation of this vulnerability.