Bug 743481 (CVE-2011-3594) - CVE-2011-3594 libpurple: invalid UTF-8 string handling in SILC messages
Summary: CVE-2011-3594 libpurple: invalid UTF-8 string handling in SILC messages
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2011-3594
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:
: 742450 (view as bug list)
Depends On: 743483 743796 743797 743798 833968
Blocks: 743482
TreeView+ depends on / blocked
 
Reported: 2011-10-05 04:14 UTC by Vincent Danen
Modified: 2021-02-24 14:34 UTC (History)
11 users (show)

Fixed In Version: pidgin 2.10.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-08 08:59:04 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1371 0 normal SHIPPED_LIVE Moderate: pidgin security update 2011-10-14 03:31:26 UTC

Description Vincent Danen 2011-10-05 04:14:55 UTC
A flaw was reported [1] in libpurple's SILC protocol plugin, and all software which uses SILC via libpurple.  The g_markup_escape_text() function, when called on strings that have not been verified as valid UTF-8, will read past the end of the string and eventually segfault for certain sequences in some versions of Glib2.  The behaviour of this function was undefined, and because it depends on the particular version of Glib2 in use, it is unknown what the complete ramifications of the flaw is, however it has been verified that an untrusted user could remotely crash a libpurple client via specially crafted SILC messages.

This flaw is believed to affect all versions of libpurple up to and including 2.10.0.  This has been corrected in the upstream git repository [2].


[1] http://developer.pidgin.im/ticket/14636
[2] http://developer.pidgin.im/viewmtn/revision/diff/be5e66abad2af29604bc794cc4c6600ab12751f3/with/7eb1f6d56cc58bbb5b56b7df53955d36b9b419b8

Comment 2 Vincent Danen 2011-10-05 04:22:03 UTC
Created pidgin tracking bugs for this issue

Affects: fedora-all [bug 743483]

Comment 5 Huzaifa S. Sidhpurwala 2011-10-05 05:08:35 UTC
*** Bug 742450 has been marked as a duplicate of this bug. ***

Comment 7 Huzaifa S. Sidhpurwala 2011-10-05 05:56:14 UTC
The crash is caused by passing "user-controlled" non-UTF8 string to the g_markup_escape_text function. 

Lot of work has already been done by the original reporter at:
http://developer.pidgin.im/ticket/14636

A non-utf8 string passed to g_markup_escape_text causes the same string to be passed along to append_escaped_text in gmarkup.c

append_escaped_text is supposed to parse this text and uses g_utf8_next_char to read the entire input string (assuming that it is utf8 of-course). g_utf8_next_char returns invalid pointers which causes "while (p != end)" loop in append_escaped_text to never exit. 

This ultimately causes OOB read and eventual client crash.

This crash can be easily reproduced by the following minimized code:



$ cat esc.c 
#include <glib.h>

void main()
{
        gchar *first;
        first = g_markup_escape_text ("\x61\xf8",2);
}


$ gcc -g -o esc `pkg-config --cflags --libs glib-2.0` esc.c

$ ./esc 
Segmentation fault (core dumped)

$ gdb -q ./esc
Reading symbols from /home/huzaifas/scratch/esc...done.
(gdb) run
Starting program: /home/huzaifas/scratch/esc 
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x000000316f2482a0 in append_escaped_text (length=<optimized out>, text=<optimized out>, str=0x601e00) at gmarkup.c:2106
2106	      next = g_utf8_next_char (p);
(gdb) bt
#0  0x000000316f2482a0 in append_escaped_text (length=<optimized out>, text=<optimized out>, str=0x601e00) at gmarkup.c:2106
#1  g_markup_escape_text (text=<optimized out>, length=<optimized out>) at gmarkup.c:2182
#2  0x000000000040052b in main () at esc.c:6
(gdb) frame 0
#0  0x000000316f2482a0 in append_escaped_text (length=<optimized out>, text=<optimized out>, str=0x601e00) at gmarkup.c:2106
2106	      next = g_utf8_next_char (p);
(gdb) p p 
$1 = (const gchar *) 0x401000 <Address 0x401000 out of bounds>

Comment 8 Huzaifa S. Sidhpurwala 2011-10-05 06:10:09 UTC
The version of pidgin shipped in Red Hat Enterprise Linux 6 explicitly disables support for SILC protocol and therefore is not affected.

This issue affects the version of pidgin shipped with Red Hat Enterprise Linux 4 and 5.

This issue affects the version of pidgin shipped with Fedora 14 and 15.

Comment 10 Vincent Danen 2011-10-14 03:25:41 UTC
Statement:

Not vulnerable.  This issue did not affect the version of pidgin as shipped with Red Hat Enterprise Linux 6 as it explicitly disables support for the SILC protocol.

Comment 11 errata-xmlrpc 2011-10-14 03:31:37 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 4
  Red Hat Enterprise Linux 5

Via RHSA-2011:1371 https://rhn.redhat.com/errata/RHSA-2011-1371.html

Comment 14 Fedora Update System 2012-01-05 20:54:58 UTC
pidgin-2.10.1-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2012-01-07 22:59:16 UTC
pidgin-2.10.1-1.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.


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