Bug 1036136 - tmux: local denial of service by creating /tmp/tmux-$UID files
Summary: tmux: local denial of service by creating /tmp/tmux-$UID files
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: tmux
Version: 7.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: David Cantrell
QA Contact: Release Test Team
Depends On: 753882
Blocks: 1036120
TreeView+ depends on / blocked
Reported: 2013-11-29 14:24 UTC by Florian Weimer
Modified: 2016-05-23 14:39 UTC (History)
3 users (show)

Fixed In Version: tmux-1.8-5.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1264783 (view as bug list)
Last Closed: 2016-05-23 14:24:39 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Debian BTS 529082 None None None Never

Description Florian Weimer 2013-11-29 14:24:07 UTC
This has already been reported as a Debian bug, <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=529082>.  If another user creates a path /tmp/tmux-$UID, user $UID cannot start tmux.

An easy fix would use XDG_RUNTIME_DIR by default, but that depends on fixing bug 753882.

Comment 3 David Cantrell 2014-08-12 18:50:03 UTC
Denied by PM for 7.1, moving to 7.2 planning list.  :/

Comment 5 David Cantrell 2015-07-17 18:06:20 UTC
Denied by PM for 7.2, moving to the 7.3 planning list.

Comment 7 David Cantrell 2016-02-08 11:23:58 UTC
Tired of dragging this one forward and never getting it approved.  Approving for 7.3.  Will implement what Debian did for this problem so there is at least some consistency across vendors (plus, Debian's fix has been present in their packages since 2009).

Comment 12 Tomas Hoger 2016-05-20 13:38:45 UTC
(In reply to Florian Weimer from comment #0)
> An easy fix would use XDG_RUNTIME_DIR by default

And that is not the fix we're trying to apply.  Instead, there are attempts to move socket file to /run and make tmux sgid to be able to write there.

I do not believe upstream tests or supports running tmux as sgid.  I see that both Debian and Fedora used to have sgid tmux at some point, but abandoned the idea.



Debian has this in NEWS.Debian:

tmux (1.4-7) unstable; urgency=low

  Starting with version 1.4-7, tmux is no longer installed setgid utmp and
  server sockets are no longer placed under /var/run/tmux, reverting to
  the default upstream behavior (sockets in a user directory under /tmp).

  We recommend that you close any open tmux sessions before proceeding
  with the upgrade. If necessary, old servers can be accessed after the
  upgrade with e.g. "tmux -S /var/run/tmux/tmux-`id -u`/default attach".

 -- Romain Francoise <rfrancoise@debian.org>  Sat, 16 Apr 2011 19:16:23 +0200

SUSE also rejected setgid approach, afaics:


Do we have a reason to believe that the approach that turned out to be wrong for both Fedora and Debian is the right thing to do for RHEL?

Florian, any thoughts from you as the reporter of this issue?

Comment 13 David Cantrell 2016-05-23 14:24:39 UTC
Following upstream and other major distributions and not installing tmux as setgid.

Note You need to log in before you can comment on or make changes to this bug.