Bug 488026 (CVE-2009-0585) - CVE-2009-0585 libsoup: integer overflow in soup_base64_encode()
Summary: CVE-2009-0585 libsoup: integer overflow in soup_base64_encode()
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2009-0585
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 488028 488029 488030 488031 488032 488033 833927
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-02 09:16 UTC by Tomas Hoger
Modified: 2019-09-29 12:28 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-20 07:41:19 UTC
Embargoed:


Attachments (Terms of Use)
Possible patch (624 bytes, patch)
2009-03-02 09:18 UTC, Tomas Hoger
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2009:0344 0 normal SHIPPED_LIVE Moderate: libsoup security update 2009-03-16 14:26:58 UTC

Description Tomas Hoger 2009-03-02 09:16:56 UTC
Older versions of libsoup are prone to integer overflow in memory requirement computation in the soup_base64_encode() in libsoup/soup-misc.c:

216 char *
217 soup_base64_encode (const char *text, int len)
218 {
219         unsigned char *out;
220         int state = 0, outlen,  save = 0;
221 
222         out = g_malloc (len * 4 / 3 + 5);

If the large enough untrusted input is passed to the function, insufficient amount of memory is allocated, followed by a heap-based buffer overflow with the Base64 encoded data.

Note: This issue does not affect current upstream versions of libsoup.  Newer version in 2.2.x branch implement base64 encoding / decoding functions as thin wrappers around functions provided by glib; 2.4.x branch does not provide base64 encoding / decoding functions any more.

Comment 1 Tomas Hoger 2009-03-02 09:17:44 UTC
Note: This issue was found during the investigation of glib2's CVE-2008-4316.

Comment 2 Tomas Hoger 2009-03-02 09:18:30 UTC
Created attachment 333717 [details]
Possible patch

Comment 6 Tomas Hoger 2009-03-02 09:34:20 UTC
Note: The issue also exists in libsoup version shipped in Red Hat Enterprise Linux 3.  However, there's not application using affected function there out of libsoup itself.  Inside libsoup, soup_base64_encode() is only used on trusted inputs.  Due to that, we currently do not plan to address this flaw on Red Hat Enterprise Linux 3.

Comment 11 Tomas Hoger 2009-03-03 15:51:56 UTC
Upstream SVN commit that changed base64 functions to glib wrappers:
  http://svn.gnome.org/viewvc/libsoup?view=revision&revision=921

Comment 14 Tomas Hoger 2009-03-12 14:51:11 UTC
Fix for glib is now committed in glib's upstream SVN now:
  https://bugzilla.redhat.com/show_bug.cgi?id=474770#c17

Lifting embargo on this too.

Comment 15 errata-xmlrpc 2009-03-16 14:27:02 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4
  Red Hat Enterprise Linux 5

Via RHSA-2009:0344 https://rhn.redhat.com/errata/RHSA-2009-0344.html

Comment 16 Red Hat Product Security 2009-03-20 07:41:19 UTC
This issue was addressed in:

Red Hat Enterprise Linux:
  http://rhn.redhat.com/errata/RHSA-2009-0344.html


Note You need to log in before you can comment on or make changes to this bug.