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


Impact
Modifying the data of other plugins
References
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/pluginsdirectory 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/pluginsdirectory.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 entireOPENC3_LOCAL_MODE_PATH.PoC
openc3-COSMOS-cmd-tlm-api) or using Bucket Explorer (plugin_default)Impact
Modifying the data of other plugins
References