Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with reading commands from file #903

Open
ad8-bdl opened this issue Dec 6, 2022 · 3 comments
Open

Issues with reading commands from file #903

ad8-bdl opened this issue Dec 6, 2022 · 3 comments

Comments

@ad8-bdl
Copy link
Contributor

ad8-bdl commented Dec 6, 2022

keeper can read commands from a file in at least three different ways (where cmds is a file containing keeper commands):

  1. keeper run-batch cmds
  2. keeper cmds
  3. keeper - < cmds (requires a previously established persistent login session keeper this-device persistent-login on)

The second approach is

I suggest just deleting the option 2 (and 3) in its entirety. Executing commands from a file/stdin should be explicit.

@ad8-bdl ad8-bdl changed the title Read commands from file Issues with reading commands from file Dec 6, 2022
@ad8-bdl
Copy link
Contributor Author

ad8-bdl commented Dec 23, 2022

Further to the problems with the 'read commands from file given as argument', it is actually is a local file inclusion vulnerability - should the user execute keeper in a working directory that happens to have a file of the same name as a keeper command, e.g. get, then keeper will execute commands from that file instead of the intended command.

% cat list
this-device
% keeper list
                     Device Name: Commander CLI on macOS
                Data Key Present: YES
                 IP Auto Approve: ON
                Persistent Login: ON
           Device Logout Timeout: 1 hour
                     Is SSO User: False

Available sub-commands:  rename, register, persistent-login, ip-auto-approve, timeout

Observe that Keeper executed the this-device​ command, not the list​ command.

Implicitly reading commands from a file (or stdin for that matter) is a misfeature at best, security flaw at worst, and should be removed, reverting to using the explicit run-batch option instead.

@sk-keeper
Copy link
Collaborator

Yes, it was not a good idea to have both keeper run-batch cmds and keeper cmds commands,
though removing the latter command will break the customer's scripts relying on it.

@ad8-bdl
Copy link
Contributor Author

ad8-bdl commented Dec 23, 2022

It's good that commander uses semantic versioning; the faulty behaviour can be deprecated now and removed in the next major release. (Though it seems the commander versioning is somehow tied to the broader keeper release numbering - which seems very odd - they're quite different codebases; sure version x.y of commander may be dependent on version n.m of the keeper API, but x.y and n.m are totally orthogonal), Anyway, leave that to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants