Red Hat Bugzilla – Bug 51318
startx in rc.local runs X as root w/out a password
Last modified: 2007-04-18 12:35:39 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Description of problem:
If you put startx at the bottom of /etc/rc.d/rc.local and reboot the os
comes up as root without having to enter a password.
Steps to Reproduce:
2.Type startx as the last entry after the 'fi' at the end of the script
3.Boot the machine
Actual Results: The machine came up into graphical mode and I was root
without ever having to type a password
Expected Results: I expected a shortcut to having the graphical login
Um, the graphical login will *never* come up as a result of running startx.
It's a consequence of running gdm, xdm, or kdm.
Yeah, I figured that but put startx in your rc.local and it runs the command
startx at boot and since rc.local runs any extra commands that you put in there
as root it runs the command startx as root which, obviously, starts X. So, in
other words it gives you an X session as root regardless of whether or not you
are root or can even log in as root. Try it and you'll see what I mean. It's
not a programmatic bug, I believe that it's a security issue.
No, it is not a programmatical bug, and no it is not a security issue
at all in any way shape or form.
1) Only root can edit rc.local
2) Root can put whatever he/she chooses in rc.local
Instead of startx, consider what would happen if root put this in rc.local:
rm -rf /
That illustrates why this is not a security issue. root can put whatever
they like in there. It is up to root to put sensible commands in the
initscripts. startx is *not* a sensible thing to put in there in a
secure environment. Solution: fire root