[libicu] [CVE-2007-4770] [CVE-2007-4771] potential execution of arbitrary code via malformed regular expressions

Bug #186578 reported by disabled.user
254
Affects Status Importance Assigned to Milestone
icu (Debian)
Fix Released
Unknown
icu (Fedora)
Fix Released
High
icu (Gentoo Linux)
Fix Released
High
icu (Ubuntu)
Fix Released
Undecided
Unassigned
Dapper
Fix Released
Undecided
Jamie Strandboge
Edgy
Fix Released
Undecided
Jamie Strandboge
Feisty
Fix Released
Undecided
Jamie Strandboge
Gutsy
Fix Released
Undecided
Jamie Strandboge
Hardy
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: libicu36

References:
MDVSA-2008:026 (http://www.mandriva.com/en/security/advisories?name=MDVSA-2008:026)

Quoting:
"Will Drewry reported multiple flaws in how libicu processed certain
malformed regular expressions. If an application linked against
libicu, such as OpenOffice.org, processed a carefully-crafted regular
expression, it could potentially cause the execution of arbitrary
code with the privileges of the user running the application."

CVE References

Revision history for this message
In , Josh (josh-redhat-bugs) wrote :

Will Drewry reported a flaw in the way libicu processes certain regular
expressions. He reports:

    On regular expression compilation, illegal backreferences may refer to the
    non-existent capture group '0'. When these are builts, they will result
    in corrupt REStackFrames which will be used at a later point. Crashes may
    result in out of band reads or writes depending on the regular expression
    being executed.

Revision history for this message
In , Caolan (caolan-redhat-bugs) wrote :

Created attachment 291973
An example of icu pattern matching in OOo

I figured out how to get OOo to match patterns with the icu regexp stuff.
Attached is a test-case which just tries to match "I am a pattern"

Revision history for this message
In , Tomas (tomas-redhat-bugs) wrote :

Created attachment 292114
Patch agains ICU 3.8 proposed by Andy Heninger

Revision history for this message
In , Caolan (caolan-redhat-bugs) wrote :

Created attachment 292482
backported patch

I can't commit to RHEL icu without approved bugzilla ids.

Revision history for this message
In , Josh (josh-redhat-bugs) wrote :
Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

icu-3.8-5.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

icu-3.6-20.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Red (red-redhat-bugs) wrote :
Revision history for this message
In , lars (lars-gentoo-bugs) wrote :

Will Drewry has reported some vulnerabilities in International Components for Unicode, which can be exploited by malicious people to cause a DoS (Denial of Service) or potentially compromise an application using the library.

1) A regular expression containing a back reference to capture group zero (\0) may reference random memory areas, which can be exploited to crash an application using the library.

2) The library does not limit the size of the backtracking stack. This can be exploited to cause a heap-based buffer overflow via certain specially crafted regular expressions.

The vulnerability is reported in version 3.8.1. Other versions may also be affected.

Solution:
Apply patch.
http://source.icu-project.org/repos/icu/icu/branches/maint/maint-3-8

Revision history for this message
In , lars (lars-gentoo-bugs) wrote :

maintainers - please provide an updated ebuild

Revision history for this message
In , jakub (jakub-gentoo-bugs) wrote :

*** Bug 207905 has been marked as a duplicate of this bug. ***

Revision history for this message
In , rbu (rbu-gentoo-bugs) wrote :

ping

Revision history for this message
In , rbu (rbu-gentoo-bugs) wrote :

I reproduced the 4771 issue on 3.6.1.
Caolan McNamara from RedHat backported the patches to 3.6:
  https://bugzilla.redhat.com/show_bug.cgi?id=429023

This bug also affects OpenOffice, as it currently uses an internal copy of icu.
OpenOffice herd, please advise here.

Revision history for this message
In , rbu (rbu-gentoo-bugs) wrote :

OpenOffice, please try building against the (security patched) libicu 3.8.1-r1 here: http://overlays.gentoo.org/svn/proj/php/migration/dev-libs/icu/

If that does not work, please patch the copy of icu.

Revision history for this message
In , suka (suka-gentoo-bugs) wrote :

(In reply to comment #5)
> OpenOffice, please try building against the (security patched) libicu 3.8.1-r1
> here: http://overlays.gentoo.org/svn/proj/php/migration/dev-libs/icu/
>
> If that does not work, please patch the copy of icu.
>

I've added a new revision (-r1) of openoffice-2.3.1 to portage, this uses external icu again (we had to back this out prior to stabilizing 2.3.1 as it was broken in OOo), works fine here on x86, other archs will have to test accordingly

Revision history for this message
In , hoffie (hoffie-gentoo-bugs) wrote :

icu-3.8.1-r1 with the patch is in the tree now, thanks to jakub. I did not do any tests except from compiling (I haven't touched that package before anyway). I might try building OOo tomorrow, but certainly not today.

Revision history for this message
In , hoffie (hoffie-gentoo-bugs) wrote :

icu-3.6-r2 in the tree as well (with the patch from redhat). You probably want 3.8* stable for OpenOffice anyway, but I don't really know, ask jakub if in doubt. ;)

Revision history for this message
In , jakub (jakub-gentoo-bugs) wrote :

(In reply to comment #8)
> icu-3.6-r2 in the tree as well (with the patch from redhat). You probably want
> 3.8* stable for OpenOffice anyway, but I don't really know, ask jakub if in
> doubt. ;)

Well, yes, definitely. It won't compile with ~icu-3.6. arches, please test and stabilize the following:

dev-libs/icu-3.6-r2 (will be hanging around for dev-libs/xerces-c-2.8.0 at least unless someone fixes the messy thing to work w/ icu-3.8.x)

dev-libs/icu-3.8.1-r1

Revision history for this message
In , ranger (ranger-gentoo-bugs) wrote :

ppc and ppc64 done.

dertobi123 tested ppc and I committed for his convenience.

Revision history for this message
In , jer (jer-gentoo-bugs) wrote :

Stable for HPPA.

Revision history for this message
In , fauli (fauli-gentoo-bugs) wrote :

x86 stable

Revision history for this message
In , armin76 (armin76-gentoo-bugs) wrote :

alpha/ia64/sparc stable

Revision history for this message
Michael Bienia (geser) wrote :

For hardy:

Please sync icu 3.8-6 from Debian unstable (main).

Changelog entries since icu 3.8-5:

icu (3.8-6) unstable; urgency=high

  * Add debian/patches/00-cve-2007-4770-4771.patch created from with
    svn diff -c 23292 \
    http://source.icu-project.org/repos/icu/icu/branches/maint/maint-3-8
    to address the following security vulnerablilities:
     - CVE-2007-4770: reference to non-existent capture group may
       cause access to invalid memory
     - CVE-2007-4771: buffer overflow in regexcmp.cpp
    (Closes: #463688)
  * Updated standards version to 3.7.3: no changes required.

 -- Jay Berkenbilt <email address hidden> Thu, 07 Feb 2008 12:58:34 -0500

Revision history for this message
Daniel Holbach (dholbach) wrote :

ACKed.

Changed in icu:
status: New → Confirmed
Revision history for this message
Martin Pitt (pitti) wrote :

synced into hardy

Changed in icu:
status: Confirmed → Fix Released
assignee: nobody → ubuntu-security
Revision history for this message
In , tester (tester-gentoo-bugs) wrote :

amd64 done

Revision history for this message
In , jakub (jakub-gentoo-bugs) wrote :

(In reply to comment #14)
> amd64 done

You missed dev-libs/icu-3.6-r2; thanks.

Revision history for this message
In , beandog (beandog-gentoo-bugs) wrote :

(In reply to comment #15)
> (In reply to comment #14)
> > amd64 done
>
> You missed dev-libs/icu-3.6-r2; thanks.
>

done

Revision history for this message
In , pva (pva-gentoo-bugs) wrote :

Updated in release snapshot.

Revision history for this message
disabled.user (disabled.user-deactivatedaccount) wrote :

Please see also:
DSA-1511-1 (http://www.debian.org/security/2008/dsa-1511)

Changed in icu:
status: Unknown → Fix Released
Revision history for this message
In , py (py-gentoo-bugs) wrote :

GLSA 200803-20

Revision history for this message
Jamie Strandboge (jdstrand) wrote :
Changed in icu:
assignee: nobody → jamie-strandboge
status: New → Fix Released
assignee: nobody → jamie-strandboge
status: New → Fix Released
assignee: nobody → jamie-strandboge
status: New → Fix Released
assignee: ubuntu-security → jamie-strandboge
status: New → Fix Released
Changed in icu:
status: Unknown → Fix Released
Changed in icu:
status: Unknown → Fix Released
Changed in icu (Gentoo Linux):
importance: Unknown → High
Changed in icu (Fedora):
importance: Unknown → High
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

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