Original issue date: January 22, 2003<br>
Last revised: March 27, 2003<br>
Source: CERT/CC<br>

<p>
A complete revision history is at the end of this file.
</p>

<br>
<h3>Systems Affected</h3>
<ul>
<li>Systems running <a href="http://www.cvshome.org/">CVS Home</a> project versions of CVS prior to 1.11.5</li>
<li>Operating system distributions that provide CVS</li>
<li>Source code repositories managed by CVS</li>
<li>For detailed vendor status information, see <a href="http://www.kb.cert.org/vuls/id/650937#systems">VU#650937</a></li>
</ul>

<br>
<h2>Overview</h2>
<p>
A "double-free" vulnerability in the Concurrent Versions System (CVS)
server could allow an unauthenticated, remote attacker with read-only
access to execute arbitrary code, alter program operation, read
sensitive information, or cause a denial of service.
</p>

<br>
<h2>I. Description</h2>
<p>
CVS is a version control and collaboration system that is
widely used by open-source software development projects.  CVS is
commonly configured to allow public, anonymous, read-only access via
the Internet.
</p>
<p>
The CVS server component contains a "double-free" vulnerability that
can be triggered by a set of specially crafted directory requests.
While processing these requests, an error-checking routine may attempt
to <font face="courier">free()</font> the same memory reference more
than once.  Deallocating the already freed memory leads to heap
corruption, which an attacker could leverage to execute arbitrary code,
alter the logical operation of the CVS server program, or read
sensitive information stored in memory.  In most cases, heap
corruption will result in a segmentation fault, causing a denial of
service.
</p>
<p>
The CVS server process is typically started by the Internet services
daemon (<font face="courier">inetd</font>) and runs with root
privileges.  Arbitrary code inserted by an attacker would therefore
run with root privileges.
</p>
<p>
This issue is being tracked as <a href="http://www.kb.cert.org/vuls/id/650937">VU#650937</a>. This reference number corresponds to <a href="http://cve.mitre.org/">CVE</a> candidate <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2003-0015">CAN-2002-0059</a>.  This issue was researched and <a href="http://security.e-matters.de/advisories/012003.html">reported</a> by Stefan Esser of <a href="http://security.e-matters.de/">e-matters</a>.
</p>

<br>
<h2>II. Impact</h2>
<p>
Depending on configuration, operating system, and platform
architecture, a remote attacker with anonymous, read-only access to a
vulnerable CVS server could execute arbitrary code, alter the
operation of the server program, read sensitive information, or cause
a denial of service.  There is also a significant secondary impact.
An attacker who is able to compromise a CVS server could modify
source-code repositories to contain Trojan horses, backdoors, or other
malicious code.
</p>

<br>
<h2>III. Solution</h2>

<h4>Apply a patch or upgrade</H4>

<p>
Apply the appropriate patch or upgrade as specified by your vendor.
See <a href="#vendors">Appendix A.</a> below and the <a href="http://www.kb.cert.org/vuls/id/650937#systems">Systems Affected</a>
section of VU#650937 for further information.
</p>

<h4>Disable or restrict anonymous CVS access</h4>
<p>
As a temporary solution until patches or upgrades can be applied, or
to improve the security of CVS servers in the long term, consider the
following workarounds and configurations:
<ul>
<li>Disable anonymous CVS server access completely.</li>
<li>Block or restrict access to CVS servers from untrusted hosts and networks.  Anonymous access to CVS servers using <font
face="courier">:cvspserver:</font> is typically provided on port
2401/tcp.</li>
<li>Configure CVS servers to run in restricted (<font face="courier">chroot</font>) environments.</li>
<li>Run CVS servers with the minimum set of privileges required on the host file system.</li>
<li>Provide separate systems for development (write) and public/anonymous (read-only) CVS access.</li>
<li>Host public/anonymous CVS servers on single-purpose, secured systems.</li>
</ul>
<p>
These workarounds and configurations are not complete solutions and
may not prevent exploitation of this vulnerability.  Other features
inherent in CVS may give anonymous users the ability to gain shell
access.
</p>

<br>
<a name="vendors"></a>
<h2>Appendix A.  Vendor Information</h2>

<p>
This appendix contains information provided by vendors.  When vendors
report new information, this section is updated and the changes are
noted in the revision history.  If a vendor is not listed below, we
have not received their comments.  The <a href="http://www.kb.cert.org/vuls/id/650937#systems">
Systems Affected</a> section of VU#650937 contains additional vendor status information.
</p>

<a name="conectiva">
<h4><a href="http://www.conectiva.com/">Conectiva</a></h4>
<blockquote>
<p>
Conectiva Linux is affected by this issue and updated packages are
available at ftp://atualizacoes.conectiva.com.br/:<br>
<br>
6.0/SRPMS/cvs-1.10.8-5U60_3cl.src.rpm<br>
6.0/RPMS/cvs-1.10.8-5U60_3cl.i386.rpm<br>
6.0/RPMS/cvs-doc-1.10.8-5U60_3cl.i386.rpm<br>
7.0/SRPMS/cvs-1.11-7U70_2cl.src.rpm<br>
7.0/RPMS/cvs-1.11-7U70_2cl.i386.rpm<br>
7.0/RPMS/cvs-doc-1.11-7U70_2cl.i386.rpm<br>
8/SRPMS/cvs-1.11-9U80_2cl.i386.rpm<br>
8/RPMS/cvs-1.11-9U80_2cl.i386.rpm<br>
8/RPMS/cvs-doc-1.11-9U80_2cl.i386.rpm<br>
<br>
An official announcement is pending and will show up in our
updates website at http://distro.conectiva.com.br/atualizacoes?idioma=en
shortly.
</p>
</blockquote>
<!-- end vendor -->

<a name="cray">
<h4><a href="http://www.cray.com/">Cray Inc.</a></h4>
<blockquote>
<p>
Cray Inc. supports CVS through their Cray Open Software (COS) package.
COS 3.3 and earlier is vulnerable.  A new CVS will be available
shortly.  Please contact your local Cray service representative if you
need this new package.
</p>
</blockquote>
<!-- end vendor -->

<a name="cvs">
<h4><a href="http://www.cvshome.org/">CVS Home</a></h4>
<blockquote>
<p>
CVS release <a href="http://ccvs.cvshome.org/servlets/NewsItemView?newsID=51">1.11.5</a> addresses this issue for CVS servers.  CVS clients are not affected.
</p>
</blockquote>
<!-- end vendor -->

<a name="debian">
<h4><a href="http://www.debian.org/">Debian</a></h4>
<blockquote>
<p>
Debian has updated their distribution with DSA 233.<br>
<a href="http://www.debian.org/security/2003/dsa-233">http://www.debian.org/security/2003/dsa-233</a>
</p>
<p>
For the stable distribution (woody) this problem has been fixed in version 1.11.1p1debian-8.1.
</p>
<p>
For the old stable distribution (potato) this problem has been fixed in version 1.10.7-9.2.
</p>
<p>
For the unstable distribution (sid) this problem will be fixed soon.
</p>
</blockquote>
<!-- end vendor -->

<a name="fujitsu">
<h4><a href="http://www.fujitsu.com/">Fujitsu</a></h4>
<blockquote>
<p>
Fujitsu's UXP/V o.s. is not vulnerable to the problem reported in
VU#650937 because it does not support CVS server.
</p>
</blockquote>
<!-- end vendor -->

<a name="compaq">
<a name="hp">
<h4><a href="http://www.hp.com/">Hewlett-Packard</a></h4>
<blockquote>
<p>
SOURCE:  Hewlett-Packard Company and Compaq Computer Corporation, a wholly-owned subsidiary of Hewlett-Packard Company<br>
<br>
RE:  x-reference SSRT3463<br>
<br>
Not Vulnerable:<br>
HP-UX<br>
HP-MPE/ix<br>
HP Tru64 UNIX<br>
HP NonStop Servers<br>
HP OpenVMS<br>
<br>
To report any security issue for any HP software products send email to  <a href="mailto:security-alert@hp.com">security-alert@hp.com</a>
</p>
</blockquote>
<!-- end vendor -->

<a name="hitachi">
<h4><a href="http://www.hitachi.com/">Hitachi</a></h4>
<blockquote>
<p>
GR2000 router does not contain any parts of the CVS.  Therefore, it is
not vulnerable.
</p>
</blockquote>
<!-- end vendor -->

<a name="ibm">
<h4><a href="http://www.ibm.com/">IBM</a></h4>
<blockquote>
<p>
The AIX operating system does not ship with CVS.  However, CVS is
available for installation on AIX from the Linux Affinity Toolbox.
</p>
<p>
CVS versions 1.11.1p1-2 and earlier are vulnerable to the issues
discussed in CERT Vulnerability Note VU#650937 and any advisories
which follow.
</p>
<p>
Users are advised to download CVS 1.11.1p1-3 from:<br>
<br>
<a href="ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/cvs/cvs-1.11.1p1-3.aix4.3.ppc.rpm">ftp://ftp.software.ibm.com/aix/freeSoftware/aixtoolbox/RPMS/ppc/cvs/<br>cvs-1.11.1p1-3.aix4.3.ppc.rpm</a><br>
<br>
Please note that the above address was wrapped to two lines.
</p>
<p>
CVS 1.11.1p1-3 contains the security fixes made in CVS 1.11.5 to address these issues.
</p>
<p>
This software is offered on an "as-is" basis.
</p>
</blockquote>
<!-- end vendor -->

<a name="ingrian">
<h4><a href="http://www.ingrian.com/">Ingrian Networks</a></h4>
<blockquote>
<p>
Ingrian Networks platforms are not vulnerable to VU#650937.
</p>
</blockquote>
<!-- end vendor -->

<a name="nec">
<h4><a href="http://www.nec.com/">NEC Corporation</a></h4>
<blockquote>
<p>
Subject: VU650937<br>
<br>
sent on January 23, 2003<br>
<br>
[Server Products]
<br>
<ul>
<li>EWS/UP 48 Series operating system<br>
- is NOT vulnerable, which does not include CVS.</li>
</ul>
</p>
</blockquote>
<!-- end vendor -->

<a name="netbsd">
<h4><a href="http://www.netbsd.org/">NetBSD</a></h4>
<blockquote>
<p>
The NetBSD project's CVS servers are constructed such that this issue
exposed no vulnerability.  Nevertheless the fix was applied, and
incorporated into the in-tree version of CVS for the benefit of NetBSD
users who may be offering their own CVS services.
</p>
</blockquote>
<!-- end vendor -->

<a name="openwall">
<h4><a href="http://www.openwall.com/">Openwall GNU/*/Linux</a></h4>
<blockquote>
<p>
We don't yet re-distribute CVS in Openwall GNU/*/Linux.  We do,
however, provide public anonymous CVS access to a copy of our
repository, hosted off a separate machine and in a chroot jail.  This
kind of vulnerabilities in CVS was expected, and our anoncvs setup is
mostly resistant to them: read-only access to the repository is
achieved primarily with the use of regular Unix permissions, not
controls built into CVS.  CVS LockDir option is used to direct CVS
lock files to a separate directory tree, actually writable to the
pseudo-user.  Nevertheless, the anoncvs server has been upgraded to
CVS 1.11.5 a few hours after it was released.
</p>
</blockquote>
<!-- end vendor -->

<a name="redhat">
<h4><a href="http://www.redhat.com/">Red Hat, Inc.</a></h4>
<blockquote>
<p>
Red Hat Linux and Red Hat Linux Advanced Server shipped with a cvs
package vulnerable to these issues.  New cvs packages are now
available along with our advisory at the URLs below.  Users of the Red
Hat Network can update their systems using the 'up2date' tool.
</p>
<p>
Red Hat Linux Advanced Server:
<blockquote>
<a href="http://rhn.redhat.com/errata/RHSA-2003-013.html">http://rhn.redhat.com/errata/RHSA-2003-013.html</a>
</blockquote>
Red Hat Linux:
<blockquote>
<a href="http://rhn.redhat.com/errata/RHSA-2003-012.html">http://rhn.redhat.com/errata/RHSA-2003-012.html</a>
</blockquote>
</p>
</blockquote>
<!-- end vendor -->

<a name="sun">
<h4><a href="http://www.sun.com/">Sun Microsystems Inc.</a></h4>
<blockquote>
<p>
Sun does not include CVS with Solaris and therefore Solaris is not
affected by this issue.  Sun does provide CVS on the Solaris Companion
CD:
<blockquote>
<a href="http://wwws.sun.com/software/solaris/freeware/index.html">http://wwws.sun.com/software/solaris/freeware/index.html</a>
</blockquote>
as an unsupported package which installs to /opt/sfw and is vulnerable
to this issue.  Sites using the freeware version of CVS from the
Solaris Companion CD will have to upgrade to a later version from CVS
Home.
</p>
<p>
Sun Linux, versions 5.0.3 and below, does ship with a vulnerable CVS
package.  Sun recommends that CVS services be disabled on affected Sun
Linux systems until patches are available for this issue.
</p>
<p>
Sun will be publishing a Sun Alert for Sun Linux describing the patch
information which will be available from:
<blockquote>
<a href="http://sunsolve.sun.com/">http://sunsolve.Sun.COM</a>
</blockquote>
</p>
</blockquote>
<!-- end vendor -->

<br>
<a name="references"></a>
<h2>Appendix B.  References</h2>
<ul>
<li>CERT/CC Vulnerability Note VU#650937 - <a href="http://www.kb.cert.org/vuls/id/650937">http://www.kb.cert.org/vuls/id/650937</a></li>
<li>e-matters Advisory 01/2003 - <a href="http://security.e-matters.de/advisories/012003.html">http://security.e-matters.de/advisories/012003.html</a></li>
</ul>

<hr noshade>
<p>
This vulnerability was <a href="http://security.e-matters.de/advisories/012003.html">reported</a> by Stefan Esser of <a href="http://security.e-matters.de/">e-matters</a>.
</p>
<hr noshade>
<p>
Author: <a href="mailto:cert@cert.org?subject=CA-2003-02%20VU%23650937%20Feedback">Art Manion</a>.
</p>

<!--#include virtual="/include/footer_nocopyright.html" -->

<p>Copyright 2003 Carnegie Mellon University.</p>

<p>Revision History
<p>
<small>
January 22, 2003:  Initial release<br>
January 23, 2003:  Fixed Red Hat advisory URL<br>
February 4, 2003:  Updated Sun statement, added Fujitsu, Hitachi, NEC, and NetBSD statements<br>
February 14, 2003:  Added Ingrian statement<br>
March 27, 2003:  Updated Solution section<br>
</small>
</p>