Richard Gooch SimpleInit Open File Descriptor Vulnerability

BID:5001

Info

Richard Gooch SimpleInit Open File Descriptor Vulnerability

Bugtraq ID: 5001
Class: Design Error
CVE: CVE-2002-0767
Remote: No
Local: Yes
Published: Jun 12 2002 12:00AM
Updated: Jul 11 2009 01:56PM
Credit: Credited to Patrick Smith <[email protected]>.
Vulnerable: Richard Gooch simpleinit 2.0.2
+ util-linux util-linux 2.11 r
Alvaro Lopes wmnetmon 0.2 p4-gnomepanelsupport
Alvaro Lopes wmnetmon 0.2 p3
Alvaro Lopes wmnetmon 0.2 p2
Alvaro Lopes wmnetmon 0.2 p1
Alvaro Lopes wmnetmon 0.2
Not Vulnerable: Alvaro Lopes wmnetmon 0.2 p5

Discussion

Richard Gooch SimpleInit Open File Descriptor Vulnerability

A vulnerability has been reported for simpleinit that may allow users to execute arbitrary commands as the superuser.

The vulnerability occurs because simpleinit may allow some child processes to inherit a file descriptor with read-write access. The file descriptor is used to access /dev/initctl and this descriptor is normally used by 'initctl', 'need' and 'provide' programs to pass instructions to simpleinit. The simpleinit process runs with root privileges.

A local user whose process inherits this file descriptor will be able to cause simpleinit to execute commands as the superuser.

Exploit / POC

Richard Gooch SimpleInit Open File Descriptor Vulnerability

The following exploit has been provided by Patrick Smith &lt;[email protected]&gt;:

Solution / Fix

Richard Gooch SimpleInit Open File Descriptor Vulnerability

Solution:
An unofficial patch has been provided by Patrick Smith <[email protected]>:

--- login-utils/simpleinit.c.orig 2001-09-29 11:09:10.000000000 -0400
+++ login-utils/simpleinit.c 2002-05-23 22:16:07.000000000 -0400
@@ -203,6 +203,18 @@
if ( ( initctl_fd = open (initctl_name, O_RDWR, 0) ) < 0 )
err ( _("error opening fifo\n") );
}
+ if ( initctl_fd >= 0 )
+ if ( fcntl (initctl_fd, F_SETFD, FD_CLOEXEC) != 0 ) {
+ err ( _("error setting close-on-exec on /dev/initctl") );
+ /* Can the fcntl ever fail? If it does, and we leave
+ the descriptor open in child processes, then any
+ process on the system will be able to write to
+ /dev/initctl and have us execute arbitrary commands
+ as root. So let's refuse to use the fifo in this
+ case. */
+ close(initctl_fd);
+ initctl_fd = -1;
+ }

if ( want_single || (access (_PATH_SINGLE, R_OK) == 0) ) do_single ();

Currently we are not aware of any vendor-supplied patches for this issue. If you feel we are in error or are aware of more recent information, please mail us at: [email protected] <mailto:[email protected]>.


Alvaro Lopes wmnetmon 0.2 p1

Alvaro Lopes wmnetmon 0.2 p2

Alvaro Lopes wmnetmon 0.2 p3

Alvaro Lopes wmnetmon 0.2 p4-gnomepanelsupport

Alvaro Lopes wmnetmon 0.2

References

Richard Gooch SimpleInit Open File Descriptor Vulnerability

References:

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report