what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

cvs-1.11.4.txt

cvs-1.11.4.txt
Posted Jan 23, 2003
Authored by Stefan Esser | Site security.e-matters.de

CVS v1.11.4 and below contains a double free bug which allows attackers with read access to execute code on the server by sending a malformed directory name. By default, CVS runs with root privileges. Patch available here.

tags | advisory, root
advisories | CVE-2003-0015
SHA-256 | cf1e29270d759e81797059b571c99eff0c58d3aa9fffcdeb234d72fc4c3a22a7

cvs-1.11.4.txt

Change Mirror Download
                           e-matters GmbH
www.e-matters.de

-= Security Advisory =-



Advisory: CVS remote vulnerability
Release Date: 2003/01/20
Last Modified: 2003/01/20
Author: Stefan Esser [s.esser@e-matters.de]

Application: CVS <= 1.11.4
Severity: A vulnerability within CVS allows remote compromise of
CVS servers.
Risk: Critical
Vendor Status: Vendor has released a bugfixed version.
Reference: http://security.e-matters.de/advisories/012003.html


Overview:

Concurrent Versions System (CVS) is the dominant open-source version
control software that allows developers to access the latest code using
a network connection. CVS version 1.11.4 and below contain a flaw that
can be used by a remote attacker to execute arbitrary code on the server.

You should also note, that the CVS client/server protocol includes two
commands (Update-prog and Checkin-prog) that can be used by any CVS user
with write access to the repository to execute arbitrary shell commands
on the server. This is a questionable feature, because it is very badly
documented, is unknown to most CVS administrators and cannot be turned
off within the configuration files.


Details:

While auditing the CVS sourcetree I found a flaw within the handling of
the Directory request within the server code. By sending a malformed
directory name it is possible to trigger an error condition that will
make the function return at a point where a global pointer variable is
already freed and has not got a new value assigned yet. This will result
in a classical double-free() when the next Directory request is handled.
With the help of other CVS requests it is possible to either leak some
information that could be used to determine the heap position or to
execute arbitrary code on systems that are known to be vulnerable to
this kind of bugs. This includes Linux, Solaris and most probably Windows
systems.

Additionally I was able to create proof of concept code that uses this
vulnerability to execute arbitrary shell commands on BSD servers. I was
able to achieve this because all allocated memory is aligned on BSD
systems which makes it very easy to get newly allocated memory blocks
into the same position of already freed blocks of the same slotsize.
In combination with some CVS requests that work on lists of pointers,
I was able to use this bug to free arbitrary memory addresses. With the
help of the information leak capabilities of this vulnerability it is
possible to guess the address of some strings that are needed for the
read/write access checks. Combined this allowes to bypass the write
access checks and to abuse the Update-prog/Checkin-prog requests to
execute arbitrary commands on the server with an anonymous read-only
account.

The impact of this vulnerability depends highly on the configuration of
the server. The CVS server is by default started via inetd with root
privileges. If CVSROOT/passwd is left writeable to the CVS user this means
a remote root compromise. You must also consider that chrooting the CVS
daemon may protect the rest of your system against the intruder but will
still leave the whole source tree vulnerable to the attacker.

Summarized this means that this vulnerability is a threat to most open
source projects because nearly all of them offer anonymous CVS access to
the source tree. Even if the attacker is not able to extend his attack
on the developer CVS server (if it is seperated at all) he could still
backdoor everything other people download from the anonymous server.


Proof of Concept:

e-matters is not going to release an exploit for this vulnerability to
the public.


Disclosure Timeline:

04. January 2003 - Vendor was notified via email. Unfourtunately the
person that I tried to contact was on vacation, so I
received no answer.
12. January 2003 - The vulnerability was disclosed to the admins of several
big public CVS repositories and to some distributors.
15. January 2003 - Vendor has committed the fix to the CVS CVS repository.
16. January 2003 - Vendor-sec was notified that a new bugfixed CVS version
will be released on 20th January.
20. January 2003 - Vendor has released a new version which fixes the double
free problem. You can download it at:
http://ccvs.cvshome.org/servlets/ProjectDownloadList


CVE Information:

The Common Vulnerabilities and Exposures project (cve.mitre.org) has
assigned the name CAN-2003-0015 to this issue.


Recommendation:

My recommendation is to immediantly update to the new version. You may also
consider applying my patch which adds the ability to turn off Update-prog
and Checkin-prog within your configuration files. You can download it from

http://security.e-matters.de/patches/cvs_disablexprog.diff

You should also consider running your CVS server chrooted over SSH instead
of using the :pserver: method. You can find a tutorial how to setup such a
server at

http://www.netsys.com/library/papers/chrooted-ssh-cvs-server.txt


GPG-Key:

http://security.e-matters.de/gpg_key.asc

pub 1024D/75E7AAD6 2002-02-26 e-matters GmbH - Securityteam
Key fingerprint = 43DD 843C FAB9 832A E5AB CAEB 81F2 8110 75E7 AAD6


Copyright 2003 Stefan Esser. All rights reserved.

--

--------------------------------------------------------------------------
Stefan Esser s.esser@e-matters.de
e-matters Security http://security.e-matters.de/

GPG-Key gpg --keyserver pgp.mit.edu --recv-key 0xCF6CAE69
Key fingerprint B418 B290 ACC0 C8E5 8292 8B72 D6B0 7704 CF6C AE69
--------------------------------------------------------------------------
Did I help you? Consider a gift: http://wishlist.suspekt.org/
--------------------------------------------------------------------------

Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close