Subject: bug#28618: Emacs Security Issue

From: Noam Postavsky <[email-masked]>
Date: Fri, 29 Sep 2017 09:24:40 -0400

Dor Azouri <[email-masked]> writes:

> This is the output in my env that demonstrates how it works (forgive
> the hebrew chars):
> ~/.emacs.d$ ls -all
> total 20
> drwx------   2 duke duke  4096 ספט 28 20:24 .
> drwxr----- 105 duke duke 16384 ספט 28 14:36 ..
> ~/.emacs.d$ echo '(let ((default-directory "/opt/")) (shell-command
> "touch stub.file"))' > init.el
> ~/.emacs.d$ ls -all /opt/ | grep stub.file
> ~/.emacs.d$ sudo emacs
> ~/.emacs.d$ ls -all /opt/ | grep stub.file
> -rw-r--r--  1 root   root      0 ספט 28 20:25 stub.file

Hmm, it doesn't happen for me.

    ~/.emacs.d$ ls -all
    total 12
    drwx------  3 npostavs npostavs 4096 Sep 29 09:19 .
    drwxr-xr-x 37 npostavs npostavs 4096 Sep 29 09:19 ..
    drwx------  2 npostavs npostavs 4096 Sep 29 09:19 auto-save-list
    ~/.emacs.d$ echo '(let ((default-directory "/opt/")) (shell-command "touch stub.file"))' > init.el
    ~/.emacs.d$ ls -all /opt/ | grep stub.file
    ~/.emacs.d$ sudo emacs
    [sudo] password for npostavs: 
    ~/.emacs.d$ ls -all /opt/ | grep stub.file

Can you do

    echo '(debug)' > ~/.emacs.d/init.el
    sudo emacs

and show the result backtrace please?