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

Add SudoBin and SudoFlags #1101

Merged
merged 1 commit into from
Oct 28, 2019
Merged

Add SudoBin and SudoFlags #1101

merged 1 commit into from
Oct 28, 2019

Conversation

Morganamilo
Copy link
Contributor

@Morganamilo Morganamilo commented Oct 28, 2019

Same as #492 but with #942 (comment).

Fixes #1031

@Morganamilo Morganamilo merged commit 9420a97 into Jguer:master Oct 28, 2019
@Jguer
Copy link
Owner

Jguer commented Oct 28, 2019

I would have added a warning pre sudo call detailing the location of sudobin if it's different from /usr/bin/sudo

@Morganamilo
Copy link
Contributor Author

Why? We don't do it with any other commands.

@Jguer
Copy link
Owner

Jguer commented Oct 28, 2019

Because changing yay's sudo bin and flags can potentially allow the execution of other commands as root.
If we can't prevent it, at least a small warning would be nice.

@Morganamilo
Copy link
Contributor Author

I guess. But a malicious program could instead change pacmanbin to a script that prompts you for your password or makes a call to sudo. It could also place a sudo binary somewhere in home and add it to path. Hell it could probably redirect all your input to a file or log your keys.

So I don't really think sudo specifically makes it any less secure.

@Jguer
Copy link
Owner

Jguer commented Oct 28, 2019

But a malicious program could instead change pacmanbin to a script that prompts you for your password or makes a call to sudo

Kind of in a different issue., since the "solution" would be to print all commands executed or do the same for pacmanbin and print when it's altered from /usr/bin/pacman

It could also place a sudo binary somewhere in home and add it to path. Hell it could probably redirect all your input to a file or log your keys.

Yes, then it would be different from /usr/bin/sudo and be printed.

The objective is not to impede user action, just inform

@Morganamilo
Copy link
Contributor Author

Surely you would have to impede the user though by adding a prompt. Otherwise you're adding a warning but still calling the potentially malicious script right after.

@Jguer
Copy link
Owner

Jguer commented Oct 28, 2019

In case of sudo commands (without NOPASSWD) or malicious sudo asking for a password, it will be prompting right below for said password.

In this scenario you're assuming user level is already compromised so executing a malicious script just in the user directories would be out of scope already.

@Morganamilo
Copy link
Contributor Author

Isn't the entire point of the warning for the case there's a malicious script? Anyway my point is the entire thing is out of scope.

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

Successfully merging this pull request may close these issues.

[Feature]- Can we get a terminal bell before sudo prompt on long builds.
3 participants