<?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>212930</bug_id>
          
          <creation_ts>2008-03-10 12:01 0000</creation_ts>
          <short_desc>www-servers/lighttpd &lt; 1.4.18-r3 mod_userdir &quot;userdir.path&quot; defaults to .  (CVE-2008-1270)</short_desc>
          <delta_ts>2008-04-10 15:42:51 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>
          <bug_file_loc>http://trac.lighttpd.net/trac/ticket/1587</bug_file_loc>
          <status_whiteboard>C3 [glsa]</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>julien.cayzac+gentoo@gmail.com</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>hoffie@gentoo.org</cc>
    
    <cc>www-servers@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>julien.cayzac+gentoo@gmail.com</who>
            <bug_when>2008-03-10 12:01:02 0000</bug_when>
            <thetext>If mod_userdir is enabled but not configured, then userdir.path default to &quot;.&quot;.
Since the homedir for the nobody account is &quot;/&quot; on gentoo, you can access files remotely by pointing a web browser to e.g. http://server.tld/~nobody/etc/passwd.


Reproducible: Always

Steps to Reproduce:
1. Install lighttpd 1.4.18
2. Add mod_userdir to modules list
3. Remove any userdir.* option if present
4. Open http://your.server.tld/~nobody/etc/passwd in a web browser.
Actual Results:  
You can grab /etc/passwd (or any world-readable file) from the server.

Expected Results:  
You should not be able to :-)

This is fixed in lighttpd&apos;s source control. The patch is here:
http://trac.lighttpd.net/trac/changeset/2120</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>julien.cayzac+gentoo@gmail.com</who>
            <bug_when>2008-03-10 12:01:59 0000</bug_when>
            <thetext>Since the bug is fixed upstream, the Gentoo package maintainer should get the patch and a glsa should be created.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2008-03-10 12:21:35 0000</bug_when>
            <thetext>This totally doesn&apos;t work on default Gentoo install; just emerge it, leave the default configuration as is and try it.

Actual result: 404 - Not Found
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>julien.cayzac+gentoo@gmail.com</who>
            <bug_when>2008-03-10 12:31:50 0000</bug_when>
            <thetext>Did you change lighttpd.conf? I have the bug with this:

var.basedir  = &quot;/var/www/localhost&quot;
var.statedir = &quot;/var/lib/lighttpd&quot;

server.modules = (
        &quot;mod_access&quot;,
        &quot;mod_accesslog&quot;,
        &quot;mod_userdir&quot;,
        &quot;mod_auth&quot;,
        &quot;mod_setenv&quot;
)

server.username                 = &quot;lighttpd&quot;
server.groupname                = &quot;lighttpd&quot;
server.document-root            = var.basedir + &quot;/htdocs&quot;
server.pid-file                 = &quot;/var/run/lighttpd.pid&quot;
server.errorlog-use-syslog      = &quot;enable&quot;
server.follow-symlink           = &quot;enable&quot;
server.event-handler            = &quot;linux-sysepoll&quot;
accesslog.use-syslog            = &quot;enable&quot;
auth.debug                      = 0
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-03-10 12:42:45 0000</bug_when>
            <thetext>The actual bug here is that userdir.path defaults to &quot;.&quot;. Uncommenting the &quot;mod_userdir&quot; line without properly configuring the module will serve every user&apos;s $HOME and /

I would consider this mostly a configuration error, because using a module without actually testing it on a server facing the public is not responsible. I&apos;m pulling in the www-servers herd for advice.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>julien.cayzac+gentoo@gmail.com</who>
            <bug_when>2008-03-10 12:52:53 0000</bug_when>
            <thetext>I agree this is a configuration error, but the lighty team accepted this one as a bug and fixed it in their source tree (so it will get fixed in their next release as well, but a -r3 release with the above patch and a GLSA would prevent others from letting their disk world readable)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>smithj@gentoo.org</who>
            <bug_when>2008-03-10 13:17:07 0000</bug_when>
            <thetext>FWIW, I agree with Julien, and I&apos;ve submitted a request for a CVE identifier: http://www.openwall.com/lists/oss-security/2008/03/10/4</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hoffie@gentoo.org</who>
            <bug_when>2008-03-10 13:20:12 0000</bug_when>
            <thetext>(In reply to comment #5)
&gt; I agree this is a configuration error, but the lighty team accepted this one as
&gt; a bug and fixed it in their source tree
Well, it&apos;s a non-practical default value which was changed. It certainly is a bug (or unexpected feature) which makes it easy to create a security problem (by not creating a proper configuration), but it is not a security problem in itself.

&gt; (so it will get fixed in their next
&gt; release as well, but a -r3 release with the above patch and a GLSA would
&gt; prevent others from letting their disk world readable)
Just btw, 1.4.19 is supposed to be released today.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-03-10 14:32:01 0000</bug_when>
            <thetext>The &quot;weird&quot; behaviour is documented in userdir.txt:

Quote from http://trac.lighttpd.net/trac/browser/branches/lighttpd-1.4.x/doc/userdir.txt?rev=1371

userdir.path
  usually it should be set to &quot;public_html&quot; to take ~/public_html/ as the document
  root
  Default: empty (document root is the home directory)
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>julien.cayzac+gentoo@gmail.com</who>
            <bug_when>2008-03-10 15:04:38 0000</bug_when>
            <thetext>(In reply to comment #8)
&gt; The &quot;weird&quot; behaviour is documented in userdir.txt:
it will likely be updated according to the new behaviour.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-03-10 15:49:35 0000</bug_when>
            <thetext>(In reply to comment #9)
&gt; (In reply to comment #8)
&gt; &gt; The &quot;weird&quot; behaviour is documented in userdir.txt:
&gt; it will likely be updated according to the new behaviour.

That was not my point. I rather wanted to say that the behaviour was documented. Don&apos;t get me wrong, I&apos;m all for getting the upstream patch into Gentoo, the security impact is just &quot;borderline&quot; for me.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-03-10 17:13:38 0000</bug_when>
            <thetext>Upstream also considers this to be a vulnerability, so I&apos;d go with them.
Assigning C3 status, www-servers, please bump.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>bangert@gentoo.org</who>
            <bug_when>2008-03-10 22:13:35 0000</bug_when>
            <thetext>-r3 is in the tree.

this useflag combo should yield no failing tests (thanks to pva):

USE=&quot;bzip2 fam fastcgi gdbm ipv6 ldap memcache pcre php rrdtool ssl test webdav
xattr -doc -lua -minimal -mysql&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>smithj@gentoo.org</who>
            <bug_when>2008-03-10 22:53:46 0000</bug_when>
            <thetext>http://www.openwall.com/lists/oss-security/2008/03/10/5 assigns CVE-2008-1270 to this issue.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-03-10 23:01:35 0000</bug_when>
            <thetext>Arches, please test and mark stable:
=www-servers/lighttpd-1.4.18-r3
Target keywords : &quot;alpha amd64 arm hppa ia64 ppc ppc64 release sh sparc x86&quot;
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jer@gentoo.org</who>
            <bug_when>2008-03-11 03:30:49 0000</bug_when>
            <thetext>Stable for HPPA.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>michal@gen2.org</who>
            <bug_when>2008-03-11 08:06:06 0000</bug_when>
            <thetext>www-servers/lighttpd-1.4.18-r3  USE=&quot;bzip2 fastcgi gdbm ipv6 pcre ssl test -doc -fam -ldap -lua -memcache -minimal -mysql -php -rrdtool -webdav -xattr&quot; compiles and run fine here.

# emerge --info
Portage 2.1.4.4 (default-linux/x86/2007.0, gcc-4.1.2, glibc-2.5-r0, 2.6.24-zen3-1337 i686)
=================================================================
System uname: 2.6.24-zen3-1337 i686 unknown
Timestamp of tree: Tue, 11 Mar 2008 07:30:01 +0000
app-shells/bash:     3.2_p17-r1
dev-lang/python:     2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS=&quot;x86&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-O2 -march=i686 -pipe&quot;
CHOST=&quot;i686-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/config&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d&quot;
CXXFLAGS=&quot;-O2 -march=i686 -pipe&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;collision-protect distlocks metadata-transfer parallel-fetch prelink sandbox sfperms strict test unmerge-orphans userfetch&quot;
GENTOO_MIRRORS=&quot;http://gentoo.prz.rzeszow.pl ftp://pandemonium.tiscali.de/pub/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo&quot;
LANG=&quot;pl_PL@euro.UTF-8&quot;
LC_ALL=&quot;pl_PL.UTF-8&quot;
LINGUAS=&quot;pl&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages&quot;
PORTAGE_TMPDIR=&quot;/usr/portage/distfiles/porttmp/&quot;
PORTDIR=&quot;/usr/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;X acl berkdb cli cracklib crypt cups dri fortran gdbm gpm gtk gtk2 iconv ipv6 isdnlog midi mudflap ncurses nls nptl nptlonly openmp pam pcre perl pppd python qt3 qt4 readline reflection session spl ssl tcpd unicode wxwindows x86 xorg zlib&quot; ALSA_CARDS=&quot;emu10k1&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; APACHE2_MODULES=&quot;actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias&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; LINGUAS=&quot;pl&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;vesa nv nvidia&quot;
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>corsair@gentoo.org</who>
            <bug_when>2008-03-11 08:45:10 0000</bug_when>
            <thetext>ppc64 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>michal@gen2.org</who>
            <bug_when>2008-03-11 08:50:17 0000</bug_when>
            <thetext>(In reply to comment #16)
&gt; www-servers/lighttpd-1.4.18-r3  USE=&quot;bzip2 fastcgi gdbm ipv6 pcre ssl test -doc
&gt; -fam -ldap -lua -memcache -minimal -mysql -php -rrdtool -webdav -xattr&quot;
&gt; compiles and run fine here
php support works good.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fauli@gentoo.org</who>
            <bug_when>2008-03-11 09:27:52 0000</bug_when>
            <thetext>x86 stable, thanks Michal.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>armin76@gentoo.org</who>
            <bug_when>2008-03-11 15:17:33 0000</bug_when>
            <thetext>alpha/ia64/sparc stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>beandog@gentoo.org</who>
            <bug_when>2008-03-11 23:36:52 0000</bug_when>
            <thetext>amd64 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-03-13 13:05:08 0000</bug_when>
            <thetext>you can holf off if you like until 213164 is in CVS.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-03-21 02:21:30 0000</bug_when>
            <thetext>This is a vote. I vote YES.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-03-21 02:22:37 0000</bug_when>
            <thetext>oh wait, ppc is not stable. somehow, I expected the other bug to enter [stable] faster.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dertobi123@gentoo.org</who>
            <bug_when>2008-03-21 09:09:48 0000</bug_when>
            <thetext>(In reply to comment #24)
&gt; oh wait, ppc is not stable. somehow, I expected the other bug to enter [stable]
&gt; faster.
&gt; 

... and now ppc is also stable.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-03-21 10:52:42 0000</bug_when>
            <thetext>vote, see above for mine</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>keytoaster@gentoo.org</who>
            <bug_when>2008-03-29 20:15:14 0000</bug_when>
            <thetext>Voting YES and filing request.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>keytoaster@gentoo.org</who>
            <bug_when>2008-04-10 15:42:51 0000</bug_when>
            <thetext>GLSA 200804-08</thetext>
          </long_desc>
      
    </bug>

</bugzilla>