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

Security flaw in server #49

Open
defeo opened this issue Nov 7, 2014 · 3 comments
Open

Security flaw in server #49

defeo opened this issue Nov 7, 2014 · 3 comments

Comments

@defeo
Copy link

defeo commented Nov 7, 2014

Hi,

Isn't this embarassing?

This allows arbitrary code execution on the server, to anyone on the same network. Not even a password protection.

@Agneli
Copy link
Owner

Agneli commented Nov 10, 2014

Hi @defeo, I agree with you.
Realy arbitrary code can be executed in server by other computer in same network.
Do you have a suggestion to improve it?

Thank you for your feedback!

@defeo
Copy link
Author

defeo commented Nov 11, 2014

Hi,

You could protect the API with a password. That wouldn't be very secure, as the password would be sent over HTTP and anyone could sniff it, but this will at least stop some trivial attacks.

If you could use HTTPS that would solve the problem, but the server key would be self generated, and the client app would not recognize it.

In my opinion, the only safe and reasonable option is to drop the "custom command" feature the way it is implemented right now. You could use configuration files on the server: the user would put somewhere a text file containing aliases for the commands he wants to use, e.g.:

restart='sudo reboot'
jingle='play jingle.wav'
...

and the client could call these commands with an URL like /custom/restart/, /custom/jingle/, etc.

That would not prevent arbitrary users from executing privileged commands, but it would at least prevent arbitrary code execution. Combined with passwords, this could be a decent protection, albeit not perfect.

Using bluetooth instead of HTTP would be a safer choice, e.g., the client implements a bluetooth mouse/keyboard protocol, while the server maps keys to commands. But I believe the FxOS bluetooth API is not ready yet.

@minj
Copy link

minj commented Dec 9, 2014

You should implement some kind of pairing mechanism using a shared secret on both the client and the server. Obviously the secret should be used cryptographically rather than sent in plain text.

E.g. 'consumer secret' in oAuth 1.0a.

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

3 participants