From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Dor Azouri <dor.azouri@safebreach.com>
Cc: 28618@debbugs.gnu.org
Subject: bug#28618: Emacs Security Issue
Date: Thu, 28 Sep 2017 07:25:32 -0400 [thread overview]
Message-ID: <87efqrf4k3.fsf@users.sourceforge.net> (raw)
In-Reply-To: <CALVPaFYqr0djs_AAG3MC3P-hPkOfZjdW-6opO5BgV_CHAAZoQw@mail.gmail.com> (Dor Azouri's message of "Wed, 27 Sep 2017 13:56:46 +0000")
tags 28618 + unreproducible
quit
Dor Azouri <dor.azouri@safebreach.com> writes:
> Reproduction steps:
> ===================
> 1) Add the following ELisp line of code to the init file. It will be
> loaded on startup and execute the command “touch /stub.file”, when “~
> /.emacs.d/” is the working directory.
> (let ((default-directory "~/.emacs.d/")) (shell-command
> "touch /stub.file"))
> 2) Wait for the user to invoke Emacs in elevated mode. The owner of
> the newly created stub file is root.
As Glenn noted, this doesn't actually work: 'sudo emacs' uses
/root/.emacs, not ~/.emacs.
~$ sudo id
uid=0(root) gid=0(root) groups=0(root)
~$ echo '(let ((default-directory "~/.emacs.d/")) (shell-command "touch /stub.file"))' > .emacs
~$ emacs # *Messages* has "touch: cannot touch '/stub.file': Permission denied"
~$ ls /stub.file
ls: cannot access '/stub.file': No such file or directory
~$ sudo emacs
~$ ls /stub.file
ls: cannot access '/stub.file': No such file or directory
next prev parent reply other threads:[~2017-09-28 11:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 13:56 bug#28618: Emacs Security Issue Dor Azouri
2017-09-27 15:44 ` John Wiegley
2017-09-27 16:02 ` Dor Azouri
2017-09-27 16:23 ` Andreas Schwab
2017-09-27 17:24 ` Glenn Morris
2017-09-27 18:03 ` Glenn Morris
2017-09-28 11:25 ` Noam Postavsky [this message]
2017-09-29 12:57 ` Dor Azouri
2017-09-29 13:24 ` Noam Postavsky
2017-09-29 16:41 ` Glenn Morris
2017-09-29 22:55 ` Noam Postavsky
2017-10-01 15:27 ` Dor Azouri
2017-10-06 2:23 ` Noam Postavsky
2018-03-17 1:43 ` Noam Postavsky
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87efqrf4k3.fsf@users.sourceforge.net \
--to=npostavs@users.sourceforge.net \
--cc=28618@debbugs.gnu.org \
--cc=dor.azouri@safebreach.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).