ClamAV 0.94.1 fixes security problem

Bug #296704 reported by Fridtjof Busse
276
This bug affects 1 person
Affects Status Importance Assigned to Milestone
clamav (Ubuntu)
Fix Released
Medium
Scott Kitterman
Dapper
Fix Released
Medium
Scott Kitterman
Gutsy
Fix Released
Medium
Scott Kitterman
Hardy
Fix Released
Medium
Scott Kitterman
Intrepid
Fix Released
Medium
Scott Kitterman

Bug Description

Binary package hint: clamav

http://lists.grok.org.uk/pipermail/full-disclosure/2008-November/065530.html

-----------------------------------------------------------------
ClamAV get_unicode_name() off-by-one buffer overflow

Copyright (c) 2008 Moritz Jodeit <moritz at jodeit.org> (2008/11/08)
-----------------------------------------------------------------

Application details:

 From http://www.clamav.net/:

 "Clam AntiVirus is an open source (GPL) anti-virus toolkit for UNIX,
 designed especially for e-mail scanning on mail gateways. It provides
 a number of utilities including a flexible and scalable multi-threaded
 daemon, a command line scanner and advanced tool for automatic
 database updates. The core of the package is an anti-virus engine
 available in a form of shared library."

Vulnerability description:

 ClamAV contains an off-by-one heap overflow vulnerability in the
 code responsible for parsing VBA project files. Successful
 exploitation could allow an attacker to execute arbitrary code with
 the privileges of the `clamd' process by sending an email with a
 prepared attachment.

 The vulnerability occurs inside the get_unicode_name() function
 in libclamav/vba_extract.c when a specific `name' buffer is passed
 to it.

 101 static char *
 102 get_unicode_name(const char *name, int size, int big_endian)
 103 {
 104 int i, increment;
 105 char *newname, *ret;
 106
 107 if((name == NULL) || (*name == '\0') || (size <= 0))
 108 return NULL;
 109
 110 newname = (char *)cli_malloc(size * 7);

 First the `size' of the `name' buffer multiplied by 7 is used to
 allocate the destination buffer `newname'. When the `name' buffer
 only consists of characters matching some specific criteria [1]
 and `big_endian' is set, the following loop can write exactly 7
 characters into the allocated destination buffer `newname' per
 character found in source buffer `name'.

 This effectively fills up the destination buffer completely. After
 the loop in line 143, the terminating NUL byte is written and
 overflows the allocated buffer on the heap.

 143 *ret = '\0';
 144
 145 /* Saves a lot of memory */
 146 ret = cli_realloc(newname, (ret - newname) + 1);
 147 return ret ? ret : newname;
 148 }

 [1] Every character matching the following condition results in
     7 characters written to the destination buffer:

  (c & 0x80 || !isprint(c)) && (c >= 10 || c < 0)

 A VBA project file embedded inside an OLE2 office document send
 as an attachment can trigger the off-by-one.

Vendor response:

 2008/10/16 Initial report to vendor
 2008/10/16 Vulnerability acknowledged by acab at clamav.net
 2008/11/03 Release of version 0.94.1

Vulnerable packages:

 All versions up to 0.94 are vulnerable.
 Version 0.94.1 fixes the problem.

Related branches

CVE References

Revision history for this message
Leonel Nunez (leonelnunez) wrote :

Attached debdif for Hardy

Applies, builds fine with pbuilder , installs fine

Revision history for this message
Leonel Nunez (leonelnunez) wrote :

Attached debdif for gutsy

Applies, builds fine with pbuilder , installs fine

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 296704] Re: ClamAV 0.94.1 fixes security problem

Did you check 0.94 too? I believe there are a couple of minor issues there
that are worth dealing with.

Revision history for this message
Leonel Nunez (leonelnunez) wrote :

Attached debdif for dapper

Applies, builds fine with pbuilder , installs fine

Changed in clamav:
assignee: nobody → kitterman
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → kitterman
importance: Undecided → Medium
status: New → In Progress
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → kitterman
assignee: nobody → kitterman
importance: Undecided → Medium
status: New → In Progress
Changed in clamav:
assignee: nobody → kitterman
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Scott Kitterman (kitterman) wrote :

Here's the plan:

Intrepid and Jaunty both have 0.94.1 release candidate. Once 0.94.1 is uploaded to Debian, I'll work on getting those updated.

Dapper/Gutsy/Hardy need this and some other patches too. I'm working on gathering those up.

Revision history for this message
Scott Kitterman (kitterman) wrote :

0.94.1 just hit incoming, so shortly ....

Revision history for this message
Leonel Nunez (leonelnunez) wrote :

> 0.94.1 just hit incoming, so shortly ....
>
> --
> ClamAV 0.94.1 fixes security problem
> https://bugs.launchpad.net/bugs/296704
> You received this bug notification because you are subscribed to clamav
> in ubuntu.
>

So no more bug hunting for 94.0 ?? even I didn't found any cve or
public data just memory leaks

Leonel

Revision history for this message
Scott Kitterman (kitterman) wrote :

Please look at 0.94. I'm working my way through the clamav svn looking for
changes to cherrypick. Hopefully between the two of us we'll get all the
stuff we need for 0.92.1.

Scott K

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package clamav - 0.94.dfsg.1-1ubuntu1

---------------
clamav (0.94.dfsg.1-1ubuntu1) jaunty; urgency=low

  * Merge from Debian Unstable (LP: #296704). Remaining Ubuntu changes:
    - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6 for
      clamav-daemon and clamav-freshclam
    - add debian/usr.bin.freshclam and debian/usr.sbin.clamd
    - debian/clamav-(daemon|freshclam).dirs: add etc/apparmor.d/force-complain
    - debian/clamav-(daemon|freshclam).install: install profiles
    - debian/clamav-(daemon|freshclam).preinst: create symlink for
      force-complain/ on pre-feisty upgrades, upgrades where apparmor-profiles
      profile is unchanged (ie non-enforcing) and upgrades where the profile
      doesn't exist.
    - debian/clamav-(daemon|freshclam).postrm: remove symlink in
      force-complain/ on purge.
    - debian/clamav-(daemon|freshclam).postinst.in: reload apparmor
    - update README.Debian with note on Apparmor
  * Update apparmor profile for clamd to work with TCP sockets (LP: #288942)

clamav (0.94.dfsg.1-1) unstable; urgency=low

  [ Stephen Gran ]
  * New upstream version (closes: #505134, #502165, #501298)
  * Handle new option SubmitDetectionStats in freshclam.conf
  * Remove RAR from the description, since we really don't handle it anymore
  * Skip 'sleep until -e socket' logic if socket is of type inet (LP #296086)

  [ Michael Meskes ]
  * Added myself as uploader.
  * Changed watch file to account for dfsg extension.
  * Do not configure temporary directory in clamd.conf anymore unless it is
    already configured there.
  * Added Basque debconf translation (closes: #500007)

  [ Michael Tautschnig ]
  * Use lsb's status_of_proc function to determine the status of the process
    and return with according exit codes (closes: #486076)
  * Updated Dutch debconf translation (thanks Paul Gevers <email address hidden>)
    (closes: #501627)
  * Changed versioned dependency of clamav-daemon to clamav-base to equals
    (closes: #500416)
  * Handle new option DetectionStatsCountry in freshclam.conf
  * Don't trust the multilib guessing stuff, always use libdir=$prefix/lib
  * Removed nowadays unused lintian overrides
  * Create md5sums control file for clamav-dbg as well (thanks, lintian)

 -- Scott Kitterman <email address hidden> Tue, 11 Nov 2008 22:24:38 -0500

Changed in clamav:
status: In Progress → Fix Released
Revision history for this message
Scott Kitterman (kitterman) wrote :

Debdiff to update Intrepid to 0.94.1. If you close your eyes and ignore the build related stuff it's not too bad.

Revision history for this message
Kees Cook (kees) wrote :

dapper, gutsy, hardy building in security queue.

Changed in clamav:
status: In Progress → Fix Committed
status: In Progress → Fix Committed
status: In Progress → Fix Committed
Revision history for this message
Scott Kitterman (kitterman) wrote :

Revised diff with the exim stuff added in again.

Revision history for this message
Sergei Genchev (sgenchev) wrote :

 Some clamav packages in ppa for Hardy have unmet dependencies:
he following packages have unmet dependencies:
  clamav-daemon: Depends: lsb-base (>= 3.2-13) but 3.2-4ubuntu1 is to be installed
  clamav-freshclam: Depends: lsb-base (>= 3.2-13) but 3.2-4ubuntu1 is to be installed
E: Broken packages
clamav-base is OK
 Do they really require lsb-base 3.2-13? Do your PPA packages depend on other PPAs?
 Could you please fix it?
 Thank you!

Revision history for this message
Scott Kitterman (kitterman) wrote :

Thanks. We'll need to drop some of the lsb status stuff then.

I just checked build-depends, not installability yet. Also, clamav bugs
aren't really appropriate for discussing the PPA packages (not part of
Ubuntu). Please feel free to mail me directly.

Revision history for this message
Sergei Genchev (sgenchev) wrote :

 Sorry about that - I was not sure where PPA really fits.

 Thank you.

> I just checked build-depends, not installability yet. Also, clamav bugs
> aren't really appropriate for discussing the PPA packages (not part of
> Ubuntu). Please feel free to mail me directly.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Test suite running added to the Intrepid package. Updated debdiff attached. The full package can get gotten from http://kitterman.com/clamav/clamav_0.94.dfsg.1-1ubuntu0.1.dsc (for now, I'll pull it down after it's uploaded).

Changed in clamav:
status: Fix Committed → Fix Released
status: Fix Committed → Fix Released
status: Fix Committed → Fix Released
Revision history for this message
Kees Cook (kees) wrote :
Changed in clamav:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.