You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
At present, 1-setup-linux-native.sh invokes sudo or su to run the package manager as root. Thus if you run the script as a peon user, and you haven't recently run sudo, you will be prompted for your shell password, or root's shell password, before returning to the shell prompt.
This incurs a small security risk, because the developer is expecting to have to type the password. Patches introduced downstream are able to mimic sudo or su's user interface, run the real sudo with the information, and do something nefarious with it behind the scenes.
Instead, at least for the sudo cases, it would be better to use sudo's -n switch. This exits with $?==1 if the user would have had to type a password. Otherwise, it runs the command as normal. If $?==1, the script should prompt the user to run some sort of no-op command with sudo, and then run the script again.
To Reproduce
$ ./1-setup-linux-native.sh
Detecting Linux OS...
ID_LIKE=debian
VERSION_ID=12
Checking dependencies...
Running apt-get (root privileges are needed)...
[sudo] password for marnanel:
Expected behavior
$ ./1-setup-linux-native.sh
Detecting Linux OS...
ID_LIKE=debian
VERSION_ID=12
Checking dependencies...
Running apt-get (root privileges are needed)...
Please execute "sudo whoami", then run this script again.
This incurs a small security risk, because the developer is expecting to have to type the password. Patches introduced downstream are able to mimic sudo or su's user interface, run the real sudo with the information, and do something nefarious with it behind the scenes.
Can you describe this scenario in more detail? Maybe step-by-step explanation?
A friend suggests that the script could just print the command for the user to run, rather than actually running it.
We thought about it.
This script is mainly intended for newbies/lazy users of and CI builds, so we are trying to remove unnecessary complexity here.
For security-conscious users/maintainers, it is better to describe the required packages and allow the user to install them manually.
Maybe we should add the requirements to the readme/install file or something like that. If you know good recommendations on how to do this better, it will be appreciated.
Describe the bug
At present, 1-setup-linux-native.sh invokes sudo or su to run the package manager as root. Thus if you run the script as a peon user, and you haven't recently run sudo, you will be prompted for your shell password, or root's shell password, before returning to the shell prompt.
This incurs a small security risk, because the developer is expecting to have to type the password. Patches introduced downstream are able to mimic sudo or su's user interface, run the real sudo with the information, and do something nefarious with it behind the scenes.
Instead, at least for the sudo cases, it would be better to use sudo's
-n
switch. This exits with$?
==1 if the user would have had to type a password. Otherwise, it runs the command as normal. If$?
==1, the script should prompt the user to run some sort of no-op command with sudo, and then run the script again.To Reproduce
Expected behavior
System information:
The text was updated successfully, but these errors were encountered: