Bug 51318 - startx in rc.local runs X as root w/out a password
Summary: startx in rc.local runs X as root w/out a password
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: XFree86-Servers
Version: 7.1
Hardware: i586
OS: Linux
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-08-09 13:28 UTC by Sean Mahan
Modified: 2007-04-18 16:35 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2001-08-09 13:28:06 UTC

Attachments (Terms of Use)

Description Sean Mahan 2001-08-09 13:28:02 UTC
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.

How reproducible:

Steps to Reproduce:
1.Edit /etc/rc.d/rc.local
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 
come up

Additional info:

Comment 1 Bill Nottingham 2001-08-09 15:04:31 UTC
Um, the graphical login will *never* come up as a result of running startx.
It's a consequence of running gdm, xdm, or kdm.

Comment 2 Sean Mahan 2001-08-09 15:18:20 UTC
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.

Comment 3 Mike A. Harris 2001-08-09 15:57:27 UTC
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

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