Skip to content

Script Runner does not Respect Command Authority when Script Crosses Target Boundary #3517

Description

@shonigmann

Describe the bug

When Command Authority is enabled, users must take command authority for a given TARGET to be able to "Start" a script for that TARGET.

However, there are no guards against that script executing commands against arbitrary targets.

For example:
Suppose User A has command authority for TARGET_1, and User B has command authority for TARGET_2.

User A is able to send manual commands only to TARGET_1, and User B is able to send manual commands only to TARGET_2.

However, if User A loads a script for TARGET_1 that includes commands to targets besides TARGET_1 (e.g. cmd("TARGET_2", "MY_CMD"), they are not prevented from running this script and issuing commands to other targets.

To Reproduce

  1. Create 2 targets, TARGET_1 and TARGET_2
  2. Enable command authority
  3. Take command authority for TARGET_1 but not TARGET_2
  4. Create a new script under the TARGET_1 directory with cmd("TARGET_2", "MY_COMMAND")
  5. Start the script

Expected behavior

Either:

  • user cannot start the script because they do not have TARGET_2 authority, or
  • script starts but fails to run the cmd() because the user does not have TARGET_2 authority

Screenshots

No response

OS

AWS EKS

OpenC3 COSMOS Version

7.2.0

Browser

Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageMore information is needed

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions