-----BEGIN PGP SIGNED MESSAGE-----

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

                   ESB-2003.0069 -- FreeBSD-SA-03:01.cvs
             remotely exploitable vulnerability in cvs server
                             05 February 2003

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

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

Product:                cvs server
Vendor:                 FreeBSD
Operating System:       All FreeBSD versions prior to 4.6-RELEASE-p7,
                         4.7-RELEASE-p4, and 5.0-RELEASE-p1
                        Linux
                        UNIX
Impact:                 Execute Arbitrary Code/Commands
Access Required:        Remote

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

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

=============================================================================
FreeBSD-SA-03:01.cvs                                        Security Advisory
                                                          The FreeBSD Project

Topic:          remotely exploitable vulnerability in cvs server

Category:       contrib
Module:         contrib_cvs
Announced:      2003-02-04
Credits:        Stefan Esser <s.esser@e-matters.de>
Affects:        x`x`All FreeBSD versions prior to 4.6-RELEASE-p7, 4.7-RELEASE-p4,
                5.0-RELEASE-p1
Corrected:      2003-01-21 22:26:46 UTC (RELENG_4)
                2003-02-04 18:05:07 UTC (RELENG_5_0)
                2003-02-04 18:07:20 UTC (RELENG_4_7)
                2003-02-04 18:08:26 UTC (RELENG_4_6)
FreeBSD only:   NO

I.   Background

The Concurrent Versions System (CVS) is a version control system.  It
may be used to access a repository locally, or to access a `remote
repository' using several different methods, including `ext' (rsh),
and `pserver' (password-authenticated server).  When accessing a
remote repository, the target machine runs the CVS server to fulfill
client requests.

II.  Problem Description

The implementation of the CVS server contains a programming error which
can lead to a block of memory being freed more than once (i.e. a
double-free bug).

Separately, the CVS server allows clients with write access to specify
arbitrary commands to execute as part of an update (update-prog) or
commit (checkin-prog).  This is a dangerous feature that is generally
not needed: there are other, safer methods of triggering program
execution.

III. Impact

An attacker may exploit the double-free bug in order to bypass write
access checks.  Combined with the update-prog/checkin-prog feature,
the attacker may be able to execute arbitrary commands with the
privileges of the CVS server.  The impact is most severe when running
the CVS server in `pserver' mode to provide read-only access to the
world (anoncvs).

IV.  Workaround

Do not use `pserver' mode directly.  Instead, use one of the safer
methods described in the following online resources:

<URL:http://openbsd.sunsite.ualberta.ca/papers/anoncvs-paper.ps>
<URL:http://www.netsys.com/library/papers/chrooted-ssh-cvs-server.txt>

V.   Solution

1) Upgrade your vulnerable system to 4.7-STABLE; or to the RELENG_4_7
(4.7-RELEASE-p4), RELENG_4_6 (4.6-RELEASE-p7), or RELENG_5_0
(5.0-RELEASE-p1) security branch dated after the correction date.

2) To patch your present system:

The following patch has been verified to apply to FreeBSD 4.6, 4.7, and
5.0 systems.

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:01/cvs.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-03:01/cvs.patch.asc

b) Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch
# cd /usr/src/gnu/usr.bin/cvs
# make obj && make depend && make && make install

VI.  Correction details

The following list contains the revision numbers of each file that was
corrected in FreeBSD.

Path                                                             Revision
  Branch
- - -------------------------------------------------------------------------
src/contrib/cvs/src/server.c
  RELENG_5_0                                                     1.17.2.1
  RELENG_4_7                                                 1.13.2.2.6.1
  RELENG_4_6                                                 1.13.2.2.4.1
- - -------------------------------------------------------------------------

VII. References

<URL:http://online.securityfocus.com/archive/1/72584>
<URL:http://security.e-matters.de/advisories/012003.html>
<URL:http://ccvs.cvshome.org/servlets/NewsItemView?newsID=51>
<URL:http://www.kb.cert.org/vuls/id/650937>
- -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+QAU9FdaIBMps37IRAvYzAKCeaZ1eWwiWNxRqgNRwnn4TwuwPPACdGF8T
0Ym2kCQxU0sJSRxmgAA/yM4=
=9+5m
- -----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.

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 use any or all of this information is
the responsibility of each user or organisation, and should be done so in
accordance with site policies and procedures.

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

If you believe that your system has been compromised, contact AusCERT or
your representative in FIRST (Forum of Incident Response and Security
Teams).

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-----
Version: 2.6.3i
Charset: noconv
Comment: http://www.auscert.org.au/render.html?it=1967

iQCVAwUBPkD3rih9+71yA2DNAQFuHAP/V7hiHVAgfZL/P887lJac45urPhGSbvqh
9VX0utX9UKZjBRpwlIBrc6JpFL+fSt/pW3dMt7dYTCx6i5MUt3iJ0vrAU3HF+Eg4
poAeWIKmVbNfDlb538dKDds2ZtXZrDTmZIz5pd+er9gvIzW5PdnkKbRSUY6h/8UQ
pU0rLP6aqWU=
=VQ7i
-----END PGP SIGNATURE-----