Install instruction on homepage are not secure
Maintainer note - please jump to code block here https://github.com/EasyEngine/easyengine/issues/796#issuecomment-401814447
wget -qO ee rt.cx/ee && sudo bash ee should be changed to
wget -qO ee https://rt.cx/ee && sudo bash ee for protecting it from MITM attacks.
@dpacmittal The rt.cx automatic redirect to HTTPS.
But still I feel attacker can perform MITM attack on rt.cx by creating fake domain and DNS injection.
@rahul286 We have to use https and setup Let's Encrypt SSL for rt.cx domain
Attacker doesn't need any complicated DNS injection for this to work, they can simply manipulate the response to first HTTP request, in which case there will be no redirection to HTTPS.
I have to agree that it's not too much for us to add the https:// part to the initial install script - especially for peace of mind for anyone who may not know that you are redirecting to a secure server.
I vote YES on this easy security fix. Good catch @dpacmittal :)
We've added LetsEncrypt SSL to the rt.cx domain. Thanks for reporting and we're closing this issue.
Still an issue.
Also, this could be simplified:
wget -qO ee https://rt.cx/ee && sudo bash ee
Could become:
wget -qO - https://rt.cx/ee | sudo -sE
Of course, some may have a (legitimate) complaint about piping directly into shell, but most newbies that are using this will simply execute the above command anyway, and the few that care will break it into two sections and read the ee script before executing.
However, you'd need to be sure that ee was encased in a bash function to ensure it was fully downloaded before execution, and also that ee worked in any POSIX shell such as dash (although you could still specify /bin/bash if required).
But adding the https:// to rt.cx would be a big, and necessary, win. Some datacenters have been known to intercept certain requests to their own local mirrors for distro repos in order to reduce their outbound bandwidth, but, even if this is done with the best of intentions and with no security compromises (and gpg sigs check out), it still means a lag for security updates as the local cache may lag behind upstream.
For something like this, where no trust has been bootstrapped at all (without some other mechanism such as gpg signatures etc), it's very important that at least this first call is achieved over https and not http.
@jamiesonbecker Thanks for suggestion on https.
The piping variant is intentionally not used. Besides that && makes sure the install script will run only if wget completes its execution successfully.
@mbtamuli lets do a http:// to https:// search and replace at all places. The idea is users should never type http:// version to start with.
@rahul286 agreed. doing this instead would force successful completion first, but of course any error message could be sent into bash as well. (of course, switching to https would also prevent that from being abused.)
#! /bin/bash
function main(){
# .... main function
}
main()
@jamiesonbecker nice idea. We will think over it.
Closing this issue as it has been fixed by - https://github.com/EasyEngine/easyengine/commit/5b8498285de95071acf2901f7a93fe0640cce2b9 and https://github.com/EasyEngine/installer/pull/5