First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 249214
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Robert Buchholz <rbu@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
glib2-CVE-2008-4316.patch glib2-CVE-2008-4316.patch patch Robert Buchholz 2009-01-16 01:33 0000 2.63 KB Details | Diff
glib-2.16.6-r1.ebuild ebuild using above patch text/plain Daniel Gryniewicz 2009-02-27 16:53 0000 2.44 KB Details
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 249214 depends on: Show dependency tree
Bug 249214 blocks:

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2008-11-29 01:43 0000
** Please note that this issue is confidential and no information should be
disclosed until it is made public, see "Whiteboard" for a date **

oCERT informed us about the following vulnerability:

Base64 encoding and decoding functions in glib suffer from
vulnerabilities during memory allocations which may result in arbitrary
code execution when processing large strings.

g_base64_encode and g_base64_decode allocate memory for their respective
behavior using a similar pattern:

  ret = g_malloc0 (input_length * 3 / 4);

In g_base64_decode, input_length is typed as a gint and its value is
derived directly from a strlen(3) call over an input string.  Since the
multiplication is evaluated prior to the division, an input_length
greater than (UINT_MAX/3), or 1431655765, will wrap resulting in smaller
allocation than required.  It is also possible to achieve the same
effect with a carefully calculated signedness overflow, like -1/4 = 0.

In g_base64_encode, input_length (or 'len' in this case) is of type
gsize.  This suffers from the same overflow as above, but without the
signedness issue.  In addition, gsize's width changes by platform which
will affect the overall reach of an encoding overflow.  However, the
decoding buffer overflow is a more likely target due to the immediate
control of the output data when overwriting the heap metadata.

------- Comment #1 From Robert Buchholz 2008-11-29 01:43:48 0000 -------
Patch and embargo timeline to be discussed.

------- Comment #2 From Rémi Cardona 2008-11-30 17:31:59 0000 -------
FYI, dev-util/pkgconfig needs to be checked because it bundles glib 1.2.x

------- Comment #3 From Diego E. 'Flameeyes' Pettenò 2008-11-30 17:36:01 0000 -------
I think g_mime was only implemented in 2.0

------- Comment #4 From Mart Raudsepp 2008-12-01 01:31:49 0000 -------
Isn't that g_base64_* stuff? None of that is used in pkg-config at least, the
static copy has only a few files, base64 ones not part of it, and pkg-config
code itself doesn't have any references to "64" and based on pkg-config
functionality I don't see a place where it would make sense to use such stuff
anyways. So this ones clear and safe

------- Comment #5 From Mart Raudsepp 2008-12-07 05:22:27 0000 -------
Any news on the patch or embargo date?

------- Comment #6 From Robert Buchholz 2008-12-07 13:56:47 0000 -------
No word from upstream yet, a patch has been proposed on Friday and the targeted
embargo date is middle of January next year. I'll attach the patch here as soon
as we have an upstream ack.

------- Comment #7 From Robert Buchholz 2009-01-16 01:33:31 0000 -------
Created an attachment (id=178655) [details]
glib2-CVE-2008-4316.patch

Matthias Clasen (who apparantly is part of the glib upstream) approved of the
attached patch by Tomas Hoger of RedHat. Please test and prepare an ebuild,
attach it to this bug. Do not commit anything to CVS, we will do prestable
testing here.

------- Comment #8 From Robert Buchholz 2009-02-25 17:44:54 0000 -------
upstream is targeting for the first week of march to lift the embargo and has
underlined that the patch is ok and will be applied in 2.20 to be released
around that time as well.
leio/remi, can we get it applied on our current stable? Please attach an ebuild
to this bug so we can test it before then. Thanks.

------- Comment #9 From Mart Raudsepp 2009-02-27 01:21:26 0000 -------
Taking the liberty to CCing Daniel and Gilles here, as I will not be able to
prepare an ebuild for glib-2.16 early enough considering the disclosure date
(will be on devaway for a week or so), and I trust their security handling and
not telling anything about this confidential bug outside here until it is
announced here to have been publicly disclosed.

I should be back around the time of the current preliminary disclosure date
though.

------- Comment #10 From Daniel Gryniewicz 2009-02-27 16:53:15 0000 -------
Created an attachment (id=183385) [details]
ebuild using above patch

Here's an ebuild for glib-2.16.2-r1 using the above patch.  I've tested it on a
stable amd64 system.

------- Comment #11 From Robert Buchholz 2009-02-27 17:01:34 0000 -------
Arch Security Liaisons, please test the attached ebuild and report it stable on
this bug.
Target keywords : "alpha amd64 arm hppa ia64 m68k ppc ppc64 s390 sh sparc x86"

CC'ing current Liaisons:
   alpha : yoswink, armin76
   amd64 : keytoaster, tester
    hppa : jer
     ppc : dertobi123
   ppc64 : corsair
   sparc : fmccor
     x86 : maekke, armin76

------- Comment #12 From Ferris McCormick 2009-02-27 18:25:14 0000 -------
Looks fine on sparc (all tests pass).

------- Comment #13 From Jeroen Roovers 2009-02-27 22:14:35 0000 -------
HPPA is OK.

------- Comment #14 From Mart Raudsepp 2009-03-02 17:44:01 0000 -------
Note that there is a typo in the attachment comment and it should get saved and
used as glib-2.16.6-r1.ebuild as the attachment name is.

------- Comment #15 From Mart Raudsepp 2009-03-02 19:33:47 0000 -------
Won't we need to pre-stable a 2.18 revision as well because 2.18 is under
stabilization right now?

------- Comment #16 From Robert Buchholz 2009-03-02 20:00:27 0000 -------
(In reply to comment #15)
> Won't we need to pre-stable a 2.18 revision as well because 2.18 is under
> stabilization right now?

From what I see, arches are not yet CC'ed on that bug report. Since this bug is
going to be public soon (no clear date yet), can the 2.18 stabling just wait
until then?
The first 2.18 ebuild revision to carry the patch would be the target for
regular stabling then.

------- Comment #17 From Robert Buchholz 2009-03-03 17:29:26 0000 -------
target date has been pushed to next week, possibly 2009-03-12.

------- Comment #18 From Mart Raudsepp 2009-03-03 17:58:57 0000 -------
(In reply to comment #16)
> (In reply to comment #15)
> > Won't we need to pre-stable a 2.18 revision as well because 2.18 is under
> > stabilization right now?
> 
> From what I see, arches are not yet CC'ed on that bug report. Since this bug is
> going to be public soon (no clear date yet), can the 2.18 stabling just wait
> until then?
> The first 2.18 ebuild revision to carry the patch would be the target for
> regular stabling then.

Arches are CC'ed on full GNOME-2.24 stabilization and the list there includes
glib-2.18

------- Comment #19 From Robert Buchholz 2009-03-03 18:54:22 0000 -------
(In reply to comment #18)
> Arches are CC'ed on full GNOME-2.24 stabilization and the list there includes
> glib-2.18

Oh, I was looking at bug 253934, but it seems the action is on bug 260063 now.
Feel free to add a 2.18 ebuild to this bug for testing by Arch Liaisons.

------- Comment #20 From Robert Buchholz 2009-03-12 16:27:47 0000 -------
This is now public and committed to upstream SVN:
http://svn.gnome.org/viewvc/glib?view=revision&revision=7973

The prestable process was not too successful, but please commit with the
gathered keywords and leave a comment once fixed versions are in the tree for
the other arches to stable.

------- Comment #21 From Tobias Scherbaum 2009-03-12 17:35:29 0000 -------
a little bit late, but 2.16.6-r1 looks good on ppc.

------- Comment #22 From Daniel Gryniewicz 2009-03-13 00:20:52 0000 -------
2.16.6-r1 is in with sparc, hppa, and ppc stable.
2.18.4-r1 is in with amd64 stable.

------- Comment #23 From Robert Buchholz 2009-03-13 21:16:43 0000 -------
Arches, please test and mark stable:
=dev-libs/glib-2.16.6-r1
Target keywords : "alpha amd64 arm hppa ia64 m68k ppc ppc64 s390 sh sparc x86"
Already stabled : "hppa ppc sparc"
Missing keywords: "alpha amd64 arm ia64 m68k ppc64 s390 sh x86"

=dev-libs/glib-2.18.4-r1
Target keywords : "alpha amd64 arm hppa ia64 m68k ppc ppc64 s390 sh sparc x86"
Already stabled : "amd64"
Missing keywords: "alpha arm hppa ia64 m68k ppc ppc64 s390 sh sparc x86"

------- Comment #24 From Stefan Behte 2009-03-15 11:44:53 0000 -------
CVE-2008-4316 (http://nvd.nist.gov/nvd.cfm?cvename=CVE-2008-4316):
  Multiple integer overflows in glib/gbase64.c in GLib before 2.20
  allow context-dependent attackers to execute arbitrary code via a
  long string that is converted either (1) from or (2) to a base64
  representation.

------- Comment #25 From Brent Baude 2009-03-15 12:55:41 0000 -------
ppc64 done

------- Comment #26 From Markus Meier 2009-03-15 15:08:16 0000 -------
amd64/x86 stable

------- Comment #27 From Tobias Klausmann 2009-03-15 17:10:30 0000 -------
Both stable on alpha.

------- Comment #28 From Raúl Porcel 2009-03-17 12:32:15 0000 -------
m68k stable, thanks to kolla for testing

------- Comment #29 From Brent Baude 2009-03-18 18:54:39 0000 -------
ppc done

------- Comment #30 From Jeroen Roovers 2009-03-23 05:21:06 0000 -------
HPPA is already stable except for 2.18.4-r1 which will be done through bug
#260063.

------- Comment #31 From Raúl Porcel 2009-03-27 17:50:08 0000 -------
arm/ia64/s390/sh/sparc stable

------- Comment #32 From Robert Buchholz 2009-04-03 13:51:28 0000 -------
GLSA 200904-02

First Last Prev Next    No search results available      Search page      Enter new bug