Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 287913 - x11-apps/xinit-1.0.8-r8: insecure creation of /tmp/.noxdm
Summary: x11-apps/xinit-1.0.8-r8: insecure creation of /tmp/.noxdm
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Security
URL:
Whiteboard: C4 [noglsa]
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-06 15:12 UTC by Ambroz Bizjak
Modified: 2009-11-08 23:37 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 Ambroz Bizjak 2009-10-06 15:12:39 UTC
When the boot parameter "gentoo=nox" is specified, /etc/init.d/xdm-setup executes the command "touch /tmp/.noxdm" (see bug 285929). This is insecure, as /tmp is world-writable. It allows someone to "touch" any file on the system if he manages to create the /tmp/.noxdm symlink before xdm-setup is called.
Also, anybody can force xdm startup to fail.

This can be solved by creating the file in a directory that is not world-writable.
Comment 1 William Hubbs gentoo-dev 2009-10-06 15:42:09 UTC
All,

suggestions for where to put this would be appreciated.  I put it in
/tmp to get it out of /etc/init.d, which is where livecd-tools was
originally putting it.  A change here will mean a change to livecd-tools
as well to keep them consistent.
Comment 2 William Hubbs gentoo-dev 2009-10-06 16:48:09 UTC
All,

I have moved the .noxdm file to /etc.
That is the only difference between -r8 and -r9, so you might want to
fast track -r9 to stable.
Comment 3 William Hubbs gentoo-dev 2009-10-06 17:00:19 UTC
I have also updated bug #286308 for livecd-tools.
Comment 4 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-10-07 16:18:18 UTC
(In reply to comment #1)
> suggestions for where to put this would be appreciated. 

I would suggest "/var/cache/xinit/.noxdm" or "/var/lib/xinit/.noxdm".
Comment 5 William Hubbs gentoo-dev 2009-10-07 16:26:17 UTC
I went ahead and put this in /etc since other files like it (such as
/etc/nologin) are also there.
Comment 6 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2009-10-07 16:26:57 UTC
The following code in x11-apps/xinit/files/xdm.initd-3 still allows to anybody to force xdm startup to fail:

   if [ -f /etc/init.d/.noxdm -o -f /tmp/.noxdm -o -f /etc/.noxdm ]; then
      einfo "Skipping ${EXE}, .noxdm found in /tmp, /etc/init.d or /etc"
      rm /etc/.noxdm /etc/init.d/.noxdm /tmp/.noxdm
      return 0
   fi
Comment 7 William Hubbs gentoo-dev 2009-10-07 17:01:52 UTC
this is fixed in -r10, you should be good to go to stable now.

William

Comment 8 Alexander Miller 2009-10-08 00:19:35 UTC
(In reply to comment #5)
> I went ahead and put this in /etc since other files like it (such as
> /etc/nologin) are also there.

That doesn't sound like a good idea to me. Files in /etc should be
maintained by the system administrator; files that change automatically
during system boot or normal operation should go to /var, as arfrever
suggested in comment #4.
Well, there are some files in /etc violoating this rule, but that isn't
a good reason to repeat this mistake over and over. (And "/etc/nologin"¹
isn't even one of them, btw.)

I'm not sure what's the best place in /var, but I'd suggest something
like "/var/run/noxdm" (no dot, I see no need to hide it).

¹) Well, when you mentioned "/etc/nologin" I had another idea.
   Why not check for both "/var/run/noxdm" (or whatever we'll call it)
   and "/etc/noxdm" in "/etc/init.d/xdm", where the latter will never
   be created or removed by the system. This  way admins may temporarily
   disable xdm without editing runlevels or bothering with boot options
   by creating "/etc/noxdm", much like "/etc/nologin" temporarily
   disables logins.
Comment 9 Alex Legler (RETIRED) archtester gentoo-dev Security 2009-10-08 20:09:43 UTC
Arches, please test and mark stable:
=x11-apps/xinit-1.0.8-r10
Target keywords : "alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86"
Comment 10 Markus Meier gentoo-dev 2009-10-09 20:21:19 UTC
amd64/arm/x86 stable
Comment 11 Tobias Klausmann (RETIRED) gentoo-dev 2009-10-11 15:32:31 UTC
Stable on alpha.
Comment 12 Jeroen Roovers (RETIRED) gentoo-dev 2009-10-11 16:59:11 UTC
Stable for HPPA.
Comment 13 Raúl Porcel (RETIRED) gentoo-dev 2009-10-11 17:37:18 UTC
ia64/s390/sh/sparc stable
Comment 14 nixnut (RETIRED) gentoo-dev 2009-10-11 20:18:54 UTC
ppc stable
Comment 15 Brent Baude (RETIRED) gentoo-dev 2009-10-18 14:16:48 UTC
ppc64 done
Comment 16 Tomáš Chvátal (RETIRED) gentoo-dev 2009-11-08 23:31:27 UTC
I have slight question, whats left to do on this bug?
Comment 17 Alex Legler (RETIRED) archtester gentoo-dev Security 2009-11-08 23:35:39 UTC
We close it.
Comment 18 William Hubbs gentoo-dev 2009-11-08 23:37:13 UTC
I'm not in security,  but nothing that I see.  We can look into moving the
file to /var in another bug since that will also require modifying
livecd-tools again.

William