Bug 488026 - (CVE-2009-0585) CVE-2009-0585 libsoup: integer overflow in soup_base64_encode()
CVE-2009-0585 libsoup: integer overflow in soup_base64_encode()
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
: Security
Depends On: 488028 488029 488030 488031 488032 488033 833927
  Show dependency treegraph
Reported: 2009-03-02 04:16 EST by Tomas Hoger
Modified: 2016-03-04 05:43 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-03-20 03:41:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Tomas Hoger 2009-03-02 04:16:56 EST
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;
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 04:17:44 EST
Note: This issue was found during the investigation of glib2's CVE-2008-4316.
Comment 2 Tomas Hoger 2009-03-02 04:18:30 EST
Created attachment 333717 [details]
Possible patch
Comment 6 Tomas Hoger 2009-03-02 04:34:20 EST
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 10:51:56 EST
Upstream SVN commit that changed base64 functions to glib wrappers:
Comment 14 Tomas Hoger 2009-03-12 10:51:11 EDT
Fix for glib is now committed in glib's upstream SVN now:

Lifting embargo on this too.
Comment 15 errata-xmlrpc 2009-03-16 10:27:02 EDT
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 03:41:19 EDT
This issue was addressed in:

Red Hat Enterprise Linux:

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