From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Closing a privilege escalation
Date: Wed, 25 Apr 2018 13:09:19 -0400 [thread overview]
Message-ID: <jwvzi1rdxxx.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: vsfu3jjkrh.fsf@fencepost.gnu.org
> A normal (uncompromised) user account inadvertently installs a malicious
> Emacs package that contains exploit code that waits to be run as root.
At that point, the account *is* compromised.
And this exploit code could just as well not wait to be run as root and
instead install a key-logger on `sudo`, after which the attacker can
`sudo` to run any code it wants.
> This entire class of exploit can be avoided by suitable sudo options
> (always_set_home etc), but that doesn't necessarily mean that Emacs
> should not do something about it.
I think running as UID=0 with $HOME pointing to a directory writable (or
containing files writable) by non-root users is fundamentally insecure.
More generally $HOME should point to a directory which is only writable
by users of higher-or-equal privilege-level.
> It seems to me, that "if UID = 0, set user-init-file, user-emacs-directory
> etc to those of root" is a simpler solution that the one you propose.
We could try and paper over the problem this way, indeed.
Rather than (re)set user-init-file and user-emacs-directory, I'd rather
reset $HOME altogether (and stash the old value somewhere, so
~root/.emacs can still read that user's ~/.emacs if they *really* want),
tho, and emit a warning message while doing it, of course, so the user
isn't caught by surprise.
Stefan
next prev parent reply other threads:[~2018-04-25 17:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 1:09 Closing a privilege escalation Richard Stallman
2018-04-25 1:18 ` Noam Postavsky
2018-04-25 22:40 ` Richard Stallman
2018-04-25 1:29 ` Lars Ingebrigtsen
2018-04-25 22:40 ` Richard Stallman
2018-04-26 7:20 ` Lars Ingebrigtsen
2018-04-26 7:52 ` Lars Ingebrigtsen
2018-04-26 21:05 ` Richard Stallman
2018-04-26 21:26 ` Tim Cross
2018-04-27 15:57 ` Richard Stallman
2018-04-27 9:50 ` Marcin Borkowski
2018-04-27 14:29 ` Clément Pit-Claudel
2018-04-25 15:25 ` Davis Herring
2018-04-25 16:47 ` Glenn Morris
2018-04-25 17:09 ` Stefan Monnier [this message]
2018-04-25 17:12 ` Stefan Monnier
2018-04-25 17:55 ` Paul Eggert
2018-04-26 21:01 ` Richard Stallman
2018-04-25 17:10 ` Søren Pilgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvzi1rdxxx.fsf-monnier+gmane.emacs.devel@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.