-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

===========================================================================
             AUSCERT External Security Bulletin Redistribution

                               ESB-2014.1195
                bozohttpd basic http authentication bypass
                               21 July 2014

===========================================================================

        AusCERT Security Bulletin Summary
        ---------------------------------

Product:           bozohttpd
Publisher:         NetBSD
Operating System:  NetBSD
Impact/Access:     Unauthorised Access -- Remote/Unauthenticated
Resolution:        Patch/Upgrade

Original Bulletin: 
   http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2014-007.txt.asc

- --------------------------BEGIN INCLUDED TEXT--------------------

- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

		 NetBSD Security Advisory 2014-007
		 =================================

Topic:		bozohttpd basic http authentication bypass

Version:	NetBSD-current:		20140708
		NetBSD 6.1*:		affected
		NetBSD 6.0*:		affected
		NetBSD 5.2*:		affected
		NetBSD 5.1*:		affected
		pkgsrc:			bozohttpd package prior to 20140708.

Severity:	Remote user may access protected files

Fixed:		NetBSD-current:		July 8th, 2014
		NetBSD-6 branch:	July 10th, 2014
		NetBSD-6-1 branch:	July 10th, 2014
		NetBSD-6-0 branch:	July 10th, 2014
		NetBSD-5 branch:	July 10th, 2014
		NetBSD-5-2 branch:	July 10th, 2014
		NetBSD-5-1 branch:	July 10th, 2014
		pkgsrc:		bozohttpd-20140708 corrects this issue

Please note that NetBSD releases prior to 5.1 are no longer supported.
It is recommended that all users upgrade to a supported release.


Abstract
========

When checking for restricted access via .htpasswd files, bozohttpd
fails to properly check for truncation, allowing specially crafted
requests to bypass access control without a password.  Files of
length 10 or more are not affected.


Technical Details
=================

A call to snprintf() was not properly checking for truncation of
a provided user path, allowing a later concatenation of the
".htpasswd" file name to exceed the maximum pathname length.  This
stops the check for .htpasswd file from working correctly, bypassing
the basic HTTP authentication scheme.  Files with names longer than
".htpasswd" are not visible as they require at least enough for a
valid path to be available.


Solutions and Workarounds
=========================

This problem only affects users of .htpasswd files.  The simplest
fix is to install the latest pkgsrc bozohttpd which fixes this
problem (and use it instead of the system httpd).

Alternatively, to fetch a fitting base.tgz from the releng builds
and install a fixed httpd from there:

cd /var/tmp
ftp http://nyftp.netbsd.org/pub/NetBSD-daily/<rel>/<build>/<arch>/binary/sets/base.tgz
cd /
tar xzpf /var/tmp/base.tgz ./usr/libexec/httpd

with the following replacements:
<rel>   = the release version you are using
<build> = the source date of the build. 20140710* and later will fit
<arch>  = your system's architecture

The following instructions describe how to upgrade your bozohttpd
binaries by updating your source tree and rebuilding and
installing a new version of bozohttpd.

The following instructions describe how to upgrade your bozohttpd
binary by updating your source tree and rebuilding and installing
a new version of bozohttpd.

* NetBSD-current:

	Systems running NetBSD-current dated from before 2014-07-08
	should be upgraded to NetBSD-current dated 2014-07-10 or later.

	The following files/directories need to be updated from the
	netbsd-current CVS branch (aka HEAD):
		src/libexec/httpd

	To update from CVS, re-build, and re-install bozohttpd:
		# cd src
		# cvs update -d -P libexec/httpd
		# cd libexec/httpd
		# make USETOOLS=no cleandir dependall
		# make USETOOLS=no install

* NetBSD 6.*:

	Systems running NetBSD 6.* sources dated from before
	2014-07-10 should be upgraded from NetBSD 6.* sources dated
	2014-07-10 or later.

	The following files/directories need to be updated from the
	netbsd-6, netbsd-6-1 or netbsd-6-0 branches:
		src/libexec/httpd

	To update from CVS, re-build, and re-install bozohttpd:

		# cd src
		# cvs update -r <branch_name> -d -P libexec/httpd
		# cd libexec/httpd
		# make USETOOLS=no cleandir dependall
		# make USETOOLS=no install

* NetBSD 5.*:

	Systems running NetBSD 5.* sources dated from before
	2014-07-10 should be upgraded from NetBSD 5.* sources dated
	2014-07-10 or later.

	The following files/directories need to be updated from the
	netbsd-5, netbsd-5-2 or netbsd-5-1 branches:
		src/libexec/httpd

	To update from CVS, re-build, and re-install bozohttpd:

		# cd src
		# cvs update -r <branch_name> -d -P libexec/httpd
		# cd libexec/httpd
		# make USETOOLS=no cleandir dependall
		# make USETOOLS=no install


Thanks To
=========

Thanks go to Mateusz Kocielski who found this problem and supplied
the fixes.


Revision History
================

	2014-07-17	Initial release


More Information
================

Advisories may be updated as new information becomes available.
The most recent version of this advisory (PGP signed) can be found at 
  http://ftp.NetBSD.org/pub/NetBSD/security/advisories/NetBSD-SA2014-007.txt.asc

Information about NetBSD and NetBSD security can be found at
http://www.NetBSD.org/ and http://www.NetBSD.org/Security/ .

Copyright 2014, The NetBSD Foundation, Inc.  All Rights Reserved.
Redistribution permitted only in full, unmodified form.

$NetBSD: NetBSD-SA2014-007.txt,v 1.1 2014/07/17 21:02:39 tonnerre Exp $

- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJTyDn4AAoJEAZJc6xMSnBuUd0P/Ajzyj/d0ZmA882zLdkAcluN
pZBeF/Qs26O70b9Ti5bsKKsy4kn/jZ7aoOKFU1G8Fw02M4+rqZ2pZmXWkoyUR5YY
kO6c4S1NKxH3ETHdx4ZQs5rg84HLr+C536nYReiB3vUuoQK4DvftBzax09+gjv1a
eqW3nki/xwDwjakaCR7vpAU6OhQ67jU2pANXG3AvvS2e8zLyae5jhHeHqQWcWFwu
/9wN1cDyW/WfdbQKrHVxHJW2rMuPZlxROPj7MR+8oTnMvzq9GdvuEX9MAac+/0Bs
A1wK91ew4LErT4plD/nTq3KRobWR/iqV2h2raBRD9C2B6dWFeCN7dp/IkUw4dnS3
zNvKW2GW3ouE6gQRL3Ys522pQyqYLSwOguzW4wu8UJTElK0rmCo/eBAi3RjKjSTL
HGGpUh6Zqw/HlT9K2SY+yan3JNCO4MNFMNO27rg5sjCLBSc0hzFCYODh2ulX0BL9
UduS+xGA87iKE0SjvD9UoZsJ0Kb46DCYLM6W/DQ/MASNFmxRpVj8h2pz9N0ijVQ3
aYuVRhiykZ/KTblZfdh95u+vZwsC83XGv3rsr4k6UjBgKMvLzAUCr2u8aXqilv/t
RG0vcuzlZ6HZqDCH1gxt7Zxc1zeQ1zCI6xvkUU27AoBX8pFQbBucjfpi05QfuvW7
XBqufeyPnTG4k7mobsBf
=HKpt
- -----END PGP SIGNATURE-----

- --------------------------END INCLUDED TEXT--------------------

You have received this e-mail bulletin as a result of your organisation's
registration with AusCERT. The mailing list you are subscribed to is
maintained within your organisation, so if you do not wish to continue
receiving these bulletins you should contact your local IT manager. If
you do not know who that is, please send an email to auscert@auscert.org.au
and we will forward your request to the appropriate person.

NOTE: Third Party Rights
This security bulletin is provided as a service to AusCERT's members.  As
AusCERT did not write the document quoted above, AusCERT has had no control
over its content. The decision to follow or act on information or advice
contained in this security bulletin is the responsibility of each user or
organisation, and should be considered in accordance with your organisation's
site policies and procedures. AusCERT takes no responsibility for consequences
which may arise from following or acting on information or advice contained in
this security bulletin.

NOTE: This is only the original release of the security bulletin.  It may
not be updated when updates to the original are made.  If downloading at
a later date, it is recommended that the bulletin is retrieved directly
from the author's website to ensure that the information is still current.

Contact information for the authors of the original document is included
in the Security Bulletin above.  If you have any questions or need further
information, please contact them directly.

Previous advisories and external security bulletins can be retrieved from:

        http://www.auscert.org.au/render.html?cid=1980

===========================================================================
Australian Computer Emergency Response Team
The University of Queensland
Brisbane
Qld 4072

Internet Email: auscert@auscert.org.au
Facsimile:      (07) 3365 7031
Telephone:      (07) 3365 4417 (International: +61 7 3365 4417)
                AusCERT personnel answer during Queensland business hours
                which are GMT+10:00 (AEST).
                On call after hours for member emergencies only.
===========================================================================
-----BEGIN PGP SIGNATURE-----
Comment: http://www.auscert.org.au/render.html?it=1967

iQIVAwUBU8xxgRLndAQH1ShLAQIzghAAnWQ4D14vdhVve68AQToT8ADLpUq8wf+A
XQRKJN1qPhxFhToIPvhMfrfsHQbUR4jO+dwyLxVgbdgafm3mYnkWMp0+AVyEO0Pw
ZiogetKSJpOiCooXhftjYyqMpibmgh7LB3L1QejtQ1YcYWg/rdh0t8hrIXsSyxF3
eA9hNOApOF/2uKbEZhHZq4jwKLZwTquZYbjR+HoN3tj7qoKqDYFfJu7wPcZrQUMu
boVBX0EJIUM8zGj8ig8zjWhrWrD4vo6KdYcsl5EudwvLKNNx/Cbfj9MjYblqnbs6
xVQHKr7BjNqy3XXIHF4ikJHPlSFG1rbIfe0jbA2fCInbkPkhsfiUvfkB3thfdTgu
7duhgMbOGuDELpGc/nvPFwgC4NsbA0aJd59nax0BA+Udbz/zQRlMmWwbwQmk7u4o
iMFKsxzZ/9viKysw+/4/DQqYzA1g3YRlVt/+zKmQUfFLwDZ4hitXoMPg6rNx3uD6
K77gZxab15oNGHa2AwHdmXDS4I0qlxWKDx8ZEvslaGftsgAfAEXWSkDvCH9lzAdA
yc7m9pEoYEDsZPesckvSdvQyDXbEz0bzaH3ttxdjng1OCAy8RyA8LaP9SLQLkYNp
idgvDb74GvYAB9Lms4irYwKtahVgwSjixS9jkw8E/VFomQfnMKKuusX8yiQGZFng
wbPvOzVqVVg=
=S98v
-----END PGP SIGNATURE-----