Details
All paths require valid authentication, and the triggering permissions (system/system_set/script_view) are below the admin/script_run/plugin-install tiers where COSMOS gates code execution. In the open-source edition authorize checks only token validity and does not enforce the permission string, so any authenticated user can perform these requests.
Suggested fix
The fix is to treat the user-writable overlay as data, never code, and to gate the writers, applied uniformly:
- Load table and cmd/tlm definitions for code-execution paths from the read-only
targets/tree only, or parse thetargets_modifiedoverlay with ERB disabled (run_erb=false); dynamically-created packet definitions are structural and never need ERB, so this does not regress that feature. - Allow only admin and the server-side dynamic-packet mechanism to write a
cmd_tlmoverlay; reject non-canonical object keys so a positional path check cannot be bypassed by a key the object store normalizes differently. - Run the Script Runner suite analysis (which executes the file) only at the
script_runtier, at every entry point. - Mirror the definition-read change in the Python implementation.