from the mailing list discussion (linked above by @racb), this response from an upstream sudo developer Todd C. Miller:
On Thu, 16 May 2019 07:48:40 -0400, Dan Streetman wrote: > I've cc'ed sudo-users, so the question to the upstream sudo list can > be summarized as: > How likely would it be for upstream sudo to add HOME to env_keep by default? Extremely unlikely. Prior to sudo 1.7.4 the HOME and MAIL environment variables were preserved in the environment by default. This can lead to programs using config files the original user's home directory, which has security implications, so the default was changed in 1.7.4. In the old days, sudo did little more than change the uid. These days sudo tries to run the command in an environment that closely matches what you would get by logging in as that user. This has proven to be safer as it more closely matches the assumptions other programs make. > We ask because Ubuntu carries a patch that adds HOME to env_keep, > unlike the default upstream, or any other Linux/Unix. We are > considering removing that patch, to match upstream defaults, of *not* > including HOME in env_keep. I would be supportive of that. I believe that resetting HOME is the safer default. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1556302 Title: Ubuntu patch to add HOME to env_keep makes custom commands vulnerable by default To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/1556302/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
