Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 509830 (CVE-2014-3421) - <app-editors/emacs-{23.4-r9,24.3-r5},<app-xemacs/gnus-1.99,<app-xemacs/mail-lib-1.83,<app-xemacs/tramp-1.52: multiple temporary file issues (CVE-2014-{3421,3422,3423,3424})
Summary: <app-editors/emacs-{23.4-r9,24.3-r5},<app-xemacs/gnus-1.99,<app-xemacs/mail-l...
Status: RESOLVED FIXED
Alias: CVE-2014-3421
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo Security
URL: https://bugzilla.redhat.com/show_bug....
Whiteboard: B4 [noglsa]
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-08 07:32 UTC by Agostino Sarubbo
Modified: 2014-08-25 20:40 UTC (History)
2 users (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 Agostino Sarubbo gentoo-dev 2014-05-08 07:32:49 UTC
From ${URL} :

Steve Kemp discovered multiple temporary file handling issues in Emacs. A local attacker could use these 
flaws to perform symbolic link attacks against users running Emacs. Original report: 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747100

CVE-2014-3421 was assigned to the issue in lisp/gnus/gnus-fun.el
Upstream fix: http://lists.gnu.org/archive/html/emacs-diffs/2014-05/msg00055.html

CVE-2014-3422 was assigned to the issue in lisp/emacs-lisp/find-gc.el
Upstream fix: http://lists.gnu.org/archive/html/emacs-diffs/2014-05/msg00056.html

CVE-2014-3423 was assigned to the issue in lisp/net/browse-url.el (this one does not currently have a fix)
Upstream note: http://lists.gnu.org/archive/html/emacs-diffs/2014-05/msg00057.html

CVE-2014-3424 was assigned to the issue in lisp/net/tramp.el
Upstream fix: http://lists.gnu.org/archive/html/emacs-diffs/2014-05/msg00060.html

References:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747100
http://seclists.org/oss-sec/2014/q2/269
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17428


@maintainer(s): after the bump, in case we need to stabilize the package, please let us know if it is ready for the stabilization or not.
Comment 1 Ulrich Müller gentoo-dev 2014-05-08 10:39:51 UTC
Here is a table of emacs slots affected by the respective issues:

   +---------------+----------------+-----+-----+-----+-----+-----+
   | CVE           | file           | :18 | :21 | :22 | :23 | :24 |
   +---------------+----------------+-----+-----+-----+-----+-----+
   | CVE-2014-3421 | gnus-fun.el    | no  | no  | yes | yes | yes |
   +---------------+----------------+-----+-----+-----+-----+-----+
   | CVE-2014-3422 | find-gc.el     | no  | yes | yes | yes | yes |
   +---------------+----------------+-----+-----+-----+-----+-----+
   | CVE-2014-3423 | browse-url.el  | no  | yes | yes | yes | yes |
   +---------------+----------------+-----+-----+-----+-----+-----+
   | CVE-2014-3424 | tramp{,-sh}.el | no  | no  | yes | yes | yes |
   +---------------+----------------+-----+-----+-----+-----+-----+

The reason why some old versions are unaffected is that they didn't yet include the code in question. 

XEmacs is also affected (CCing XEmacs team):
- The code in gnus, browse-url, and tramp is very similar to that in GNU Emacs. This affects packages app-xemacs/gnus, app-xemacs/mail-lib, and app-xemacs/tramp, respectively.
- find-gc.el is part of app-xemacs/xemacs-devel, but the code is different, and doesn't seem to create any files in /tmp.


(In reply to Agostino Sarubbo from comment #0)
> CVE-2014-3423 was assigned to the issue in lisp/net/browse-url.el (this one
> does not currently have a fix)
> Upstream note:
> http://lists.gnu.org/archive/html/emacs-diffs/2014-05/msg00057.html

Should we wait for a fix for this one? AFAICS, Gentoo has never packaged Mosaic, so it's unlikely that users would have a ~/.mosaicpid file (and a process running under that pid). Security team, please advise.
Comment 2 Ulrich Müller gentoo-dev 2014-05-08 15:23:31 UTC
(In reply to Ulrich Müller from comment #1)
> XEmacs is also affected (CCing XEmacs team):
> - The code in gnus, browse-url, and tramp is very similar to that in GNU
> Emacs. This affects packages app-xemacs/gnus, app-xemacs/mail-lib, and
> app-xemacs/tramp, respectively.
> - find-gc.el is part of app-xemacs/xemacs-devel, but the code is different,
> and doesn't seem to create any files in /tmp.

Reported to XEmacs upstream: http://tracker.xemacs.org/XEmacs/its/issue868
Comment 3 Ulrich Müller gentoo-dev 2014-05-08 18:56:57 UTC
I've backported the upstream patches for CVE-2014-3421, 3422, and 2324 to Emacs versions 24.3 (trivial) and 23.4: <http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=commit;h=f93ca92566a63f8dce17b92ae23b0e79757a0a36>

> CVE-2014-3423 was assigned to the issue in lisp/net/browse-url.el (this one
> does not currently have a fix)
> Upstream note:
> http://lists.gnu.org/archive/html/emacs-diffs/2014-05/msg00057.html

This can only be solved by removing the functionality for old Mosaic versions:
<http://git.overlays.gentoo.org/gitweb/?p=proj/emacs-tools.git;a=blob;f=emacs/24.3/07_all_browse-url-no-mosaic.patch;h=3ccab76711588e12152decd6a898edcab84c0953;hb=refs/heads/patchsets>

All four issues should therefore be fixed in these revisions:
  app-editors/emacs-23.4-r9
  app-editors/emacs-24.3-r5


CCing arch teams, please stabilise above ebuilds. (You'll need to stabilise the dependency app-emacs/emacs-common-gentoo-1.4-r1 as well.)
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2014-05-09 01:31:26 UTC
Is it really so hard to put three atoms on separate lines and put the target keywords on a separate line?

Is it this? It can't be because this doesn't mention app-editors/xemacs yet.

=app-editors/emacs-23.4-r9
=app-editors/emacs-24.3-r5
=app-emacs/emacs-common-gentoo-1.4-r1

Targeted stable KEYWORDS : alpha amd64 arm hppa ia64 ppc ppc64 sparc x86
Comment 5 Ulrich Müller gentoo-dev 2014-05-09 04:58:08 UTC
(In reply to Jeroen Roovers from comment #4)
> Is it really so hard to put three atoms on separate lines and put the target
> keywords on a separate line?

All information is there in comment #3.
Re-adding arch teams to CC, please stabilise:

   app-editors/emacs-23.4-r9
   app-editors/emacs-24.3-r5
   app-emacs/emacs-common-gentoo-1.4-r1 (needed as dependency)
Comment 6 Ulrich Müller gentoo-dev 2014-05-09 05:01:17 UTC
And no, waiting for XEmacs packages to be fixed before stabilising the GNU Emacs ones makes no sense.
Comment 7 Ulrich Müller gentoo-dev 2014-05-09 06:21:30 UTC
(In reply to Agostino Sarubbo from comment #0)
> CVE-2014-3423 was assigned to the issue in lisp/net/browse-url.el (this one
> does not currently have a fix)

Patch from upstream is available now, using this in 23.4-r10 and 24.3-r6:
http://lists.gnu.org/archive/html/emacs-diffs/2014-05/msg00084.html

Arch teams, please stabilise:

    app-editors/emacs-23.4-r10
    app-editors/emacs-24.3-r6
    app-emacs/emacs-common-gentoo-1.4-r1 (needed as dependency)
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2014-05-09 14:19:36 UTC
Thanks.
Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2014-05-09 15:55:35 UTC
Stable for HPPA.
Comment 10 Yury German Gentoo Infrastructure gentoo-dev 2014-05-09 21:42:17 UTC
OK this vulnerability is affecting:
app-editors/emacs
app-xemacs/gnus
app-xemacs/mail-lib
app-xemacs/tramp
app-editors/xemacs ?

Some of them are listed as part of the bugs. Do we want to split this vulnerability up, for emacs a and a new bug for xemacs or just stabilize one and then call for another stabilization again later (which is confusing in my mind).
Comment 11 Ulrich Müller gentoo-dev 2014-05-10 05:03:48 UTC
(In reply to Yury German from comment #10)
> OK this vulnerability is affecting:
> app-editors/emacs
> app-xemacs/gnus
> app-xemacs/mail-lib
> app-xemacs/tramp
> app-editors/xemacs ?

app-editors/xemacs itself isn't affected. XEmacs is modular, so most of its lisp files are in separate packages.

> Some of them are listed as part of the bugs. Do we want to split this
> vulnerability up, for emacs a and a new bug for xemacs or just stabilize one
> and then call for another stabilization again later (which is confusing in
> my mind).

I've changed the Whiteboard for now. (This scheme was previously used in <https://bugs.gentoo.org/show_activity.cgi?id=221197>, so I hope it is o.k.)
Comment 12 Markus Meier gentoo-dev 2014-05-15 20:02:08 UTC
arm stable
Comment 13 Mats Lidell gentoo-dev 2014-05-27 21:34:56 UTC
The app-xemacs/*-packages have been updated upstream conserning the temporary file issues and are now in the state pre-released (as defined by upstream.) I need to figure out the best way to get that into gentoo stable.
Comment 14 Ulrich Müller gentoo-dev 2014-06-07 23:22:30 UTC
(In reply to Ulrich Müller from comment #7)
> Arch teams, please stabilise:
> 
>     app-editors/emacs-23.4-r10
>     app-editors/emacs-24.3-r6
>     app-emacs/emacs-common-gentoo-1.4-r1 (needed as dependency)

Update, please stabilise these versions:

    app-editors/emacs-23.4-r11
    app-editors/emacs-24.3-r6
    app-emacs/emacs-common-gentoo-1.4-r1 (needed as dependency)
Comment 15 Agostino Sarubbo gentoo-dev 2014-06-08 09:42:24 UTC
amd64 stable
Comment 16 Agostino Sarubbo gentoo-dev 2014-06-08 10:32:46 UTC
alpha stable
Comment 17 Agostino Sarubbo gentoo-dev 2014-06-08 10:42:02 UTC
ia64 stable
Comment 18 Agostino Sarubbo gentoo-dev 2014-06-08 10:45:42 UTC
ppc64 stable
Comment 19 Agostino Sarubbo gentoo-dev 2014-06-08 10:49:04 UTC
ppc stable
Comment 20 Agostino Sarubbo gentoo-dev 2014-06-08 10:51:39 UTC
sparc stable
Comment 21 Agostino Sarubbo gentoo-dev 2014-06-08 10:59:52 UTC
x86 stable.

Maintainer(s), please cleanup.
Security, please vote.
Comment 22 Ulrich Müller gentoo-dev 2014-06-08 11:54:24 UTC
(In reply to Agostino Sarubbo from comment #21)
> Maintainer(s), please cleanup.

All vulnerable versions of GNU Emacs removed.
Comment 23 GLSAMaker/CVETool Bot gentoo-dev 2014-06-08 13:38:08 UTC
CVE-2014-3424 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2014-3424):
  lisp/net/tramp-sh.el in GNU Emacs 24.3 and earlier allows local users to
  overwrite arbitrary files via a symlink attack on a /tmp/tramp.#####
  temporary file.

CVE-2014-3423 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2014-3423):
  lisp/net/browse-url.el in GNU Emacs 24.3 and earlier allows local users to
  overwrite arbitrary files via a symlink attack on a /tmp/Mosaic.#####
  temporary file.

CVE-2014-3422 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2014-3422):
  lisp/emacs-lisp/find-gc.el in GNU Emacs 24.3 and earlier allows local users
  to overwrite arbitrary files via a symlink attack on a temporary file under
  /tmp/esrc/.

CVE-2014-3421 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2014-3421):
  lisp/gnus/gnus-fun.el in GNU Emacs 24.3 and earlier allows local users to
  overwrite arbitrary files via a symlink attack on the /tmp/gnus.face.ppm
  temporary file.
Comment 24 Mats Lidell gentoo-dev 2014-07-12 23:19:08 UTC
Using upstream pre-release packages for solving the xemacs packages security issues. 

Arch teams, please stabilise:

    app-xemacs/gnus-1.99
    app-xemacs/mail-lib-1.83
    app-xemacs/tramp-1.52

Keywords: alpha amd64 ppc ppc64 sparc x86
Comment 25 Agostino Sarubbo gentoo-dev 2014-07-14 13:26:25 UTC
(In reply to Mats Lidell from comment #24)
> Using upstream pre-release packages for solving the xemacs packages security
> issues. 
> 
> Arch teams, please stabilise:
> 
>     app-xemacs/gnus-1.99
>     app-xemacs/mail-lib-1.83
>     app-xemacs/tramp-1.52
> 
> Keywords: alpha amd64 ppc ppc64 sparc x86

Do we have any other packages to stabilize to fix this bug?
Comment 26 Mats Lidell gentoo-dev 2014-07-14 23:40:31 UTC
No these three are the only remaining packages that needs to be stabilized.
Comment 27 Tobias Klausmann (RETIRED) gentoo-dev 2014-07-20 12:47:10 UTC
Stable on alpha.
Comment 28 Agostino Sarubbo gentoo-dev 2014-08-02 13:44:27 UTC
amd64 stable
Comment 29 Agostino Sarubbo gentoo-dev 2014-08-02 13:48:05 UTC
x86 stable
Comment 30 Raúl Porcel (RETIRED) gentoo-dev 2014-08-04 18:36:04 UTC
sparc stable
Comment 31 Tobias Heinlein (RETIRED) gentoo-dev 2014-08-04 19:05:49 UTC
Regarding GLSA vote, I vote NO.
Comment 32 Agostino Sarubbo gentoo-dev 2014-08-08 21:42:32 UTC
ppc stable
Comment 33 Agostino Sarubbo gentoo-dev 2014-08-09 10:49:34 UTC
ppc64 stable.

Maintainer(s), please cleanup.
Security, please vote.
Comment 34 Ulrich Müller gentoo-dev 2014-08-14 07:08:50 UTC
(In reply to Agostino Sarubbo from comment #33)
> Maintainer(s), please cleanup.

All vulnerable versions removed. Thanks matsl.
Comment 35 Kristian Fiskerstrand (RETIRED) gentoo-dev 2014-08-25 20:27:37 UTC
GLSA Vote: No
Comment 36 Yury German Gentoo Infrastructure gentoo-dev 2014-08-25 20:40:35 UTC
Arches and Maintainer(s), Thank you for your work.

GLSA Vote: No
No GLSA - Closing Bug as Resolved