<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>189412</bug_id>
          <alias>CVE-2007-5714</alias>
          <creation_ts>2007-08-18 23:18 0000</creation_ts>
          <short_desc>net-p2p/mldonkey created user &quot;p2p&quot; has a passwordless login (CVE-2007-5714)</short_desc>
          <delta_ts>2007-11-07 20:04:17 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Security</product>
          <component>Vulnerabilities</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <status_whiteboard>[glsa errata?] jaervosz</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>gentoo@torabi.de</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>net-p2p@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>gentoo@torabi.de</who>
            <bug_when>2007-08-18 23:18:41 0000</bug_when>
            <thetext>I found out that the user &quot;p2p&quot; on my system had a passwordless login.
It was even possible to login via ssh!
I did not create that user; I think it was created by &quot;net-p2p/mldonkey-2.8.2-r1&quot;
On an older installation that problem was not existing.
I did not check yet what happens with the recent ebuilds.

genlop mldonkey:
 * net-p2p/mldonkey

     Wed Mar 14 18:23:06 2007 &gt;&gt;&gt; net-p2p/mldonkey-2.8.2-r1
     Sun Apr  8 23:29:15 2007 &gt;&gt;&gt; net-p2p/mldonkey-2.8.3
     Wed Apr 11 00:32:12 2007 &gt;&gt;&gt; net-p2p/mldonkey-2.8.4
     Fri Jun 15 16:09:15 2007 &gt;&gt;&gt; net-p2p/mldonkey-2.8.5
     Sun Jul 29 05:50:20 2007 &gt;&gt;&gt; net-p2p/mldonkey-2.9.0

If you need more information please tell. I did not attach an emerge --info because it might be irrelevant and has probably changed since March.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-08-19 06:58:34 0000</bug_when>
            <thetext>&gt; I did not check yet what happens with the recent ebuilds.

Still the same thing.

&lt;snip&gt;
enewuser ${MLUSER} -1 /bin/bash /home/p2p users
&lt;/snip&gt;
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-08-19 19:04:42 0000</bug_when>
            <thetext>net-p2p please advise and fix as necessary.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@torabi.de</who>
            <bug_when>2007-08-20 09:33:29 0000</bug_when>
            <thetext>(In reply to comment #1)
&gt; enewuser ${MLUSER} -1 /bin/bash /home/p2p users

Unfortunatly I am not to aware of the password-problem in that line, are all the others that one gets with:
grep enewuser /usr/portage/* | grep bash
fine?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-08-20 09:36:37 0000</bug_when>
            <thetext>(In reply to comment #3)
&gt; Unfortunatly I am not to aware of the password-problem in that line, are all
&gt; the others that one gets with:

enewuser doesn&apos;t set any password, the shell should be -1 (i.e. /bin/false) to prevent this issue. If that&apos;s not possible, then mldonkey has bigger problems than just enewuser.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@torabi.de</who>
            <bug_when>2007-08-21 12:36:37 0000</bug_when>
            <thetext>If that user does need a valid shell how about a random password?

Since the last argument of enewuser [params] is passed directly to useradd this should work:
&lt;workaround&gt;
enewuser ${MLUSER} -1 /bin/bash /home/${MLUSER} users --password $(dd count=1 if=/dev/random 2&gt;/dev/null| md5sum | awk &apos;{print $1}&apos;)
&lt;/workaround&gt;
or am I wrong?
What is done here is I&apos;ll get some random data from the kernel (/dev/random) and calculate the md5sum of that.
If the password is ever needed the admin can still change it.

I&apos;ll have to ask again:
Does this problem exist in all packages that use enewuser with a valid shell?

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>armin76@gentoo.org</who>
            <bug_when>2007-08-27 17:19:08 0000</bug_when>
            <thetext>Fixed in -r3.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-08-28 20:30:17 0000</bug_when>
            <thetext>Arches please test and mark stable. Target keywords are:

mldonkey-2.9.0-r3.ebuild:KEYWORDS=&quot;~alpha amd64 hppa ia64 ppc ~sparc x86&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jer@gentoo.org</who>
            <bug_when>2007-08-29 00:13:48 0000</bug_when>
            <thetext>Stable for HPPA.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>armin76@gentoo.org</who>
            <bug_when>2007-08-29 09:36:43 0000</bug_when>
            <thetext>ia64/x86 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dertobi123@gentoo.org</who>
            <bug_when>2007-08-29 19:16:48 0000</bug_when>
            <thetext>ppc stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jonas@chown.dk</who>
            <bug_when>2007-09-04 19:37:25 0000</bug_when>
            <thetext>net-p2p/mldonkey-2.9.0-r3  USE=&quot;gd gtk -doc -fasttrack -gnutella -guionly -magic&quot;

1. Emerges on AMD64.
2. No collisions etc. 
3. Works on AMD64 and p2p user no longer have a valid shell. 

Portage 2.1.2.12 (default-linux/amd64/2007.0/desktop, gcc-4.1.2, glibc-2.5-r4, 2.6.22-gentoo-r2 x86_64)
=================================================================
System uname: 2.6.22-gentoo-r2 x86_64 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz
Gentoo Base System release 1.12.9
Timestamp of tree: Mon, 03 Sep 2007 21:50:01 +0000
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS=&quot;amd64&quot;
CBUILD=&quot;x86_64-pc-linux-gnu&quot;
CFLAGS=&quot;-march=nocona -Os -msse3 -pipe -fomit-frame-pointer&quot;
CHOST=&quot;x86_64-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/splash /etc/terminfo&quot;
CXXFLAGS=&quot;-march=nocona -Os -msse3 -pipe -fomit-frame-pointer&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;ccache collision-protect distcc distlocks metadata-transfer multilib-strict parallel-fetch sandbox sfperms strict test&quot;
GENTOO_MIRRORS=&quot;http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ http://trumpetti.atm.tut.fi/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ds.thn.htu.se/linux/gentoo&quot;
LC_ALL=&quot;en_DK.utf8&quot;
MAKEOPTS=&quot;-j6&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/portage/local/layman/php-testing /usr/local/portage&quot;
SYNC=&quot;rsync://rsync.europe.gentoo.org/gentoo-portage&quot;
USE=&quot;X a52 aac acl acpi aiglx alsa amd64 apache2 arts atk berkdb bitmap-fonts cairo cdr cli cracklib crypt cups dbus dga directfb dri dts dvd dvdr dvdread eds emboss encode evo fam fbcn ffmpeg firefox fortran ftp gd gdbm gif gphoto2 gpm gstreamer gtk hal iconv icq ieee1394 ipv6 isdnlog java jpeg kde kerberos lm_sensors mad midi mikmod mjpeg mmx mozilla mp2 mp3 mpeg mplayer msn mudflap ncurses nls nptl nptlonly ogg oggvorbis opengl openmp pam pcre pda pdf perl png ppds pppd python qt qt3 qt3support qt4 quicktime readline reflection samba sdl session spell spl sse sse2 sse3 ssl svg tcpd test threads tiff truetype truetype-fonts type1-fonts unicode vorbis x264 xcomposite xml xorg xscreensaver xv xvid zlib&quot; ALSA_CARDS=&quot;ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; ELIBC=&quot;glibc&quot; INPUT_DEVICES=&quot;keyboard mouse&quot; KERNEL=&quot;linux&quot; LCD_DEVICES=&quot;bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;radeon&quot;
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>angelos@gentoo.org</who>
            <bug_when>2007-09-05 14:09:42 0000</bug_when>
            <thetext>amd64 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-09-08 15:47:56 0000</bug_when>
            <thetext>Hmmm, if this report is correct it is worth a GLSA in my opinion. Comments/thoughts?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aetius@gentoo.org</who>
            <bug_when>2007-09-09 22:26:12 0000</bug_when>
            <thetext>Yep, GLSA it - there&apos;s guaranteed to be systems out there with this user created, since everyone who emerged it would have added the user.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-09-09 22:30:59 0000</bug_when>
            <thetext>Just noting here that mere upgrading doesn&apos;t actually solve the issue. enewuser won&apos;t do anything if the user already exists - people who have installed this before need to either userdel the account and then upgrade, or modify it manually.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>legate@legate.xs4all.nl</who>
            <bug_when>2007-09-10 14:38:04 0000</bug_when>
            <thetext>&gt;Just noting here that mere upgrading doesn&apos;t actually solve the issue. enewuser
&gt;won&apos;t do anything if the user already exists - people who have installed this
&gt;before need to either userdel the account and then upgrade, or modify it
&gt;manually.

I may be dense, but if you&apos;re not gonna add logic to change the shell then what exactly is the point of adding a new revision?
FWIW, 4 other users had the same problem (valid shell with no password set) on my system: uucp, games, postgres and jetty</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@torabi.de</who>
            <bug_when>2007-09-10 15:40:32 0000</bug_when>
            <thetext>&gt; exactly is the point of adding a new revision?
Now the problem does not occur anymore on newly installed systems.

&gt; FWIW, 4 other users had the same problem (valid shell with no password set) on
&gt; my system: uucp, games, postgres and jetty

That is what I guessed there are probably some other packages with the same problem.
I tried it with flexlm-9.5-r1
(enewuser flexlm -1 /bin/bash /opt/flexlm flexlm -c &quot;FlexLM server user&quot;)
but that account seems secure.

Maybe a check like in =app-forensics/rkhunter-1.2.9
(/usr/bin/rkhunter in line 4145)
should be put in the ebuilds.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-09-10 16:21:16 0000</bug_when>
            <thetext>legate you&apos;re right. We&apos;ll have a GLSA to get this fixed.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>falco@gentoo.org</who>
            <bug_when>2007-10-24 22:15:55 0000</bug_when>
            <thetext>GLSA 200710-25, sorry for the delay</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>max@city.veganet.ru</who>
            <bug_when>2007-10-26 08:59:04 0000</bug_when>
            <thetext>(In reply to comment #19)
&gt; GLSA 200710-25, sorry for the delay
&gt; 
JFYI, there is a difference between no password and empty password.

Here is a paragraph from man 5 shadow

If the password field contains some string that is not valid result of crypt(3), for instance ! or *, the user will not be able to use a unix password to log in, subject to pam(7).
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-10-26 11:20:33 0000</bug_when>
            <thetext>For the record: As mentioned in the original bug report it affects ssh if you have PermitEmptyPasswords yes and UsePAM no.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>subcreator@post.ru</who>
            <bug_when>2007-10-26 15:48:47 0000</bug_when>
            <thetext>That DOESN&apos;T work in any case!

# cat /etc/passwd /etc/shadow | grep p2p
p2p:x:106:100:added by portage for mldonkey:/home/p2p:/bin/bash
p2p:!:13597:0:99999:7:::

# cat /etc/ssh/sshd_config | egrep &quot;PermitEmpty|UsePAM&quot;
PermitEmptyPasswords yes
UsePAM no

# ssh p2p@localhost
Permission denied (publickey,keyboard-interactive).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-10-26 17:33:05 0000</bug_when>
            <thetext>Hmmm actually I&apos;m not able to reproduce this using enewuser.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-10-26 18:50:54 0000</bug_when>
            <thetext>(In reply to comment #23)
&gt; Hmmm actually I&apos;m not able to reproduce this using enewuser.

See Bug 193541. No idea how many people are affected by this and what caused it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>max@city.veganet.ru</who>
            <bug_when>2007-10-26 22:39:14 0000</bug_when>
            <thetext>(In reply to comment #24)
&gt; (In reply to comment #23)
&gt; &gt; Hmmm actually I&apos;m not able to reproduce this using enewuser.
&gt; 
&gt; See Bug 193541. No idea how many people are affected by this and what caused
&gt; it.
Actually i don&apos;t care about that bug, but i&apos;m little scared about how easy GLSA with High importance can be pushed based on the wrong roots and providing resolution unrelated to the real problem. This drops shadow on GLSA process in overall.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-10-27 07:35:00 0000</bug_when>
            <thetext>This seems like a major slip:( Reopning to decide what to do. I propose an errata.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-10-27 07:36:14 0000</bug_when>
            <thetext>Or perhaps just an update stating that it have to be an old install?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>alexxy@gentoo.org</who>
            <bug_when>2007-10-27 07:41:12 0000</bug_when>
            <thetext>(In reply to comment #27)
&gt; Or perhaps just an update stating that it have to be an old install?
&gt; 

Close this bug since it&apos;s not reproducible
&apos;!&apos; in the second fiel in /etc/shadow  means that user is locked and can&apos;t login anymore </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2007-10-27 09:57:03 0000</bug_when>
            <thetext>What mistake are we discussing here?

1) That the passwd/shadow situation cannot be reproduced with recent installs?
2) That the vulnerability (if reproduced) is invalid?

Comment 22 seems to point at (2), but I have to add there: It does work if you enable PAM (UsePAM yes).

If we talk about (1): To update the GLSA, we&apos;d have to find out when enewuser was changed to insert a &quot;:!:&quot; instead of &quot;::&quot;.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>subcreator@post.ru</who>
            <bug_when>2007-10-29 07:17:16 0000</bug_when>
            <thetext>2 Robert Buchholz:
I installed mldonkey on 25 of march 2007, so the bug at least 7 months old. I.e. all ebuilds later than that date is unaffected.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2007-10-31 01:09:38 0000</bug_when>
            <thetext>When updating the GLSA, please add a reference to CVE-2007-5714.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-11-07 20:04:17 0000</bug_when>
            <thetext>Reworded description slightly and added CVE entry.

-    This user is created with a valid login shell and no password.
+    With older Portage versions this user is created with a valid login
+    shell and no password.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>