Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 636188 (CVE-2017-1000383) - app-editors/emacs: umask is ignored when creating backup save files
Summary: app-editors/emacs: umask is ignored when creating backup save files
Status: RESOLVED INVALID
Alias: CVE-2017-1000383
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Security
URL: http://www.openwall.com/lists/oss-sec...
Whiteboard: B4 [upstream cve]
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-01 19:04 UTC by Aleksandr Wagner (Kivak)
Modified: 2017-11-02 06:09 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksandr Wagner (Kivak) 2017-11-01 19:04:33 UTC
CVE-2017-1000383 (http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-1000383):

GNU Emacs version 25.3.1 (and other versions most likely) ignores umask when creating a backup save file ("[ORIGINAL_FILENAME]~") resulting in files that may be world readable or otherwise accessible in ways not intended by the user running the emacs binary. 

References:

http://www.openwall.com/lists/oss-security/2017/10/31/1

@ Maintainer(s): Please confirm which versions in the tree are vulnerable.
Comment 1 Ulrich Müller gentoo-dev 2017-11-02 05:54:11 UTC
I cannot reproduce this:

$ umask 077
$ echo hallo >foo
$ ls -l foo
-rw------- 1 ulm users 6 Nov  2 06:52 foo
$ emacs -Q foo
$ ls -l foo foo~
-rw------- 1 ulm users 7 Nov  2 06:52 foo
-rw------- 1 ulm users 6 Nov  2 06:52 foo~
$ emacs --version
GNU Emacs 25.3.1
Copyright (C) 2017 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Comment 2 Ulrich Müller gentoo-dev 2017-11-02 06:01:04 UTC
(In reply to Aleksandr Wagner (Kivak) from comment #0)
> References:
> 
> http://www.openwall.com/lists/oss-security/2017/10/31/1

This seems to be about vim, not emacs?

> @ Maintainer(s): Please confirm which versions in the tree are vulnerable.

Tested with:
   app-editors/emacs-18.59-r11
   app-editors/emacs-23.4-r16
   app-editors/emacs-24.5-r4
   app-editors/emacs-25.3
   app-editors/emacs-vcs-26.0.90

All of them appear to work as intended, i.e. I cannot reproduce claimed behaviour with any of them.
Comment 3 Hans de Graaff gentoo-dev Security 2017-11-02 06:09:15 UTC
With this scenario I'm seeing something different:

$ touch file
$ ls -l file
-rw-r--r-- 1 graaff users 0 Nov  2 07:03 file
$ umask 077
$ emacs file
$ ls -l
total 1.0K
-rw-r--r-- 1 graaff users 2 Nov  2 07:03 file
-rw-r--r-- 1 graaff users 0 Nov  2 07:03 file.~1~


Still this is not a bug, given that conceptually no new file has been created. Letting existing file (and their backups) keep the original permissions even when umask changes seems to be the right thing to do.