<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>76665</bug_id>
          
          <creation_ts>2005-01-04 10:21 0000</creation_ts>
          <short_desc>www-client/dillo: format string vulnerability, arbritrary code execution likely.</short_desc>
          <delta_ts>2005-08-15 21:27:44 0000</delta_ts>
          
          
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Security</product>
          <component>Vulnerabilities</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://dev.gentoo.org/~taviso/dillo.htm</bug_file_loc>
          <status_whiteboard>B2 [glsa]</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>taviso@gentoo.org</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>usata@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-01-04 10:21:51 0000</bug_when>
            <thetext>using dillo, visit the URL above, then look at the statusbar message.

If you see a message like &quot;Not Found: fa854ef32fa342&quot; or similar, dillo interpreted the format string specifiers I sent it in the specially crafted html file. This could likely be used to execute arbritrary code simply by visiting an attackers website, or viewing an html email (some mua&apos;s use dillo for html rendering, i use with muttt when no plain text part is sent!).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-01-04 10:55:35 0000</bug_when>
            <thetext>btw, the responsible code is at interface.c:1061

here&apos;s some backtrace

Breakpoint 1, a_Interface_msg (bw=0x80f4118, format=0x81c8570 &quot;File Not Found: /%x%x%x&quot;) at interface.c:1061
(gdb) bt
#0  a_Interface_msg (bw=0x80f4118, format=0x81c8570 &quot;File Not Found: /%x%x%x&quot;) at interface.c:1061
#1  0x0805b7f1 in a_Capi_ccc (Op=2, Branch=2, Dir=1, Info=0x81cbc40, Data1=0x81c7df8, Data2=0x81c84b0) at capi.c:500
#2  0x0805bd2d in a_Chain_fcb (Op=2, Info=0x81cbd10, Data1=0x81c7df8, Data2=0x81c84b0) at chain.c:89
#3  0x080ac14e in Dpi_parse_token (conn=0x81cbc60) at dpi.c:263
#4  0x080ac35f in Dpi_process_io (Op=0, Data1=0x81cbd30, conn=0x81cbc60) at dpi.c:317
#5  0x080ad1e5 in a_Dpi_ccc (Op=2, Branch=3, Dir=1, Info=0x81cbd10, Data1=0x81cbd30, Data2=0x0) at dpi.c:703
#6  0x0805bd2d in a_Chain_fcb (Op=2, Info=0x81cbc00, Data1=0x81cbd30, Data2=0x0) at chain.c:89
#7  0x080ae696 in a_IO_ccc (Op=2, Branch=2, Dir=1, Info=0x81cbc00, Data1=0x81cbd30, Data2=0x0) at IO.c:691
#8  0x080adfc2 in IO_read (io=0x81cbd30) at IO.c:466
#9  0x080ae249 in IO_callback (src=0x81cbc28, cond=17, data=0x5) at IO.c:556
#10 0x4039c474 in g_io_add_watch () from /usr/lib/libglib-1.2.so.0</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-04 11:33:48 0000</bug_when>
            <thetext>Tavis: I assume you find it, so I will temporarily set Component to Auditing so that the Audit team can verify it.

Looks like a classic format string thing to me, but I didn&apos;t look at the code.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-01-04 14:05:22 0000</bug_when>
            <thetext>Okay, here are some of the details for whoever checks it out:

vulnerable code:

   1051 /*
   1052  * Set the status string on the bottom of the dillo window.
   1053  */
   1054 void a_Interface_msg(BrowserWindow *bw, const char *format, ... )
   1055 {
   1056    static char msg[1024];
   1057    va_list argp;
   1058 
   1059    if ( bw ) {
   1060       va_start(argp, format);
   1061       vsnprintf(msg, 1024, format, argp);
   1062       va_end(argp);
   1063       a_I18n_gtk_label_set_text(GTK_LABEL(bw-&gt;status), msg);
   1064       bw-&gt;status_is_link = 0;
   1065    }
   1066 }

Nothing wrong with this, but look at how it&apos;s called in capi.c:

    498             } else if (strcmp(Data2, &quot;send_status_message&quot;) == 0) {
    499                gchar *Data1_enc = a_I18n_locale_to_DILLO_CHARSET(Data1);
    500                a_Interface_msg(conn-&gt;dd-&gt;bw, Data1_enc);
    501                g_free(Data1_enc);
    502             } else if (strcmp(Data2, &quot;chat&quot;) == 0) {

where Data1_enc is unfiltered and can be controlled via the html, I&apos;ve attached a patch that fixes this issue. I think this is a fairly textbook error, shouldnt  cause any problems to an attacker.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-01-04 14:06:22 0000</bug_when>
            <thetext>Created an attachment (id=47645)
fix format string bug

actually, i can see there&apos;s another one in there as well, so I fixed that one
as well :)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-05 08:12:19 0000</bug_when>
            <thetext>This looks rather clear to me. Switching to vulnerability.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-01-05 08:41:41 0000</bug_when>
            <thetext>upstream informed (security@ cc&apos;ed).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-01-06 05:05:52 0000</bug_when>
            <thetext>upstream maintainer has replied via email, the issue is now fixed in CVS and plans to make a release candidate later today for a planned full release before Jan 15th.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-06 06:07:52 0000</bug_when>
            <thetext>This is CAN-2005-0012, public since it leaked from the Dillo Changelogs.

usata: please bump to 0.8.3-r4 with patch, or to 0.8.4_rc1 if it&apos;s out (your choice).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-07 05:40:21 0000</bug_when>
            <thetext>Tavis: usata is not available now, I think he won&apos;t matter if you commit the patch and/or the rc1 version on his behalf.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-01-07 05:59:30 0000</bug_when>
            <thetext>Okay, I&apos;ll bounce some of the info to usata and he can decide about -rc1, it&apos;s such a simple patch for 0.8.3 I don&apos;t expect any issues with it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-01-07 06:48:11 0000</bug_when>
            <thetext>www-client/dillo-0.8.3-r4 contains the patch, already stable on x86.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-07 07:41:27 0000</bug_when>
            <thetext>sparc ppc alpha amd64 arm: please test and mark stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kingtaco@gentoo.org</who>
            <bug_when>2005-01-07 18:52:30 0000</bug_when>
            <thetext>amd64 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>pylon@gentoo.org</who>
            <bug_when>2005-01-07 21:42:32 0000</bug_when>
            <thetext>ppc stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kloeri@gentoo.org</who>
            <bug_when>2005-01-08 13:06:07 0000</bug_when>
            <thetext>Stable on alpha.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>weeve@gentoo.org</who>
            <bug_when>2005-01-08 18:12:34 0000</bug_when>
            <thetext>Stable on sparc.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-09 10:40:43 0000</bug_when>
            <thetext>Draft ready, security please review</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-09 14:11:32 0000</bug_when>
            <thetext>GLSA 200501-11
arm, please mark stable to benefit from GLSA</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>usata@gentoo.org</who>
            <bug_when>2005-01-18 04:30:55 0000</bug_when>
            <thetext>Thanks taviso and koon. I didn&apos;t have time to look at it.
I&apos;ll add dillo-0.8.4.ebuild to CVS asap.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>47645</attachid>
            <date>2005-01-04 14:06 0000</date>
            <desc>fix format string bug</desc>
            <filename>dillo-format-string-exploit.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHNyYy9jYXBpLmMub3JpZwkyMDA1LTAxLTA0IDIxOjU5OjUyLjIzOTI1MDI0MCArMDAwMAor
Kysgc3JjL2NhcGkuYwkyMDA1LTAxLTA0IDIyOjAwOjM0LjgyODc3NTY0OCArMDAwMApAQCAtNDk3
LDExICs0OTcsMTEgQEAKIAogICAgICAgICAgICAgfSBlbHNlIGlmIChzdHJjbXAoRGF0YTIsICJz
ZW5kX3N0YXR1c19tZXNzYWdlIikgPT0gMCkgewogCQkJICAgZ2NoYXIgKkRhdGExX2VuYyA9IGFf
STE4bl9sb2NhbGVfdG9fRElMTE9fQ0hBUlNFVChEYXRhMSk7Ci0gICAgICAgICAgICAgICBhX0lu
dGVyZmFjZV9tc2coY29ubi0+ZGQtPmJ3LCBEYXRhMV9lbmMpOworICAgICAgICAgICAgICAgYV9J
bnRlcmZhY2VfbXNnKGNvbm4tPmRkLT5idywgIiVzIiwgRGF0YTFfZW5jKTsKIAkJCSAgIGdfZnJl
ZShEYXRhMV9lbmMpOwogICAgICAgICAgICAgfSBlbHNlIGlmIChzdHJjbXAoRGF0YTIsICJjaGF0
IikgPT0gMCkgewogCQkJICAgZ2NoYXIgKkRhdGExX2VuYyA9IGFfSTE4bl9sb2NhbGVfdG9fRElM
TE9fQ0hBUlNFVChEYXRhMSk7Ci0gICAgICAgICAgICAgICBhX0ludGVyZmFjZV9tc2coY29ubi0+
ZGQtPmJ3LCBEYXRhMSk7CisgICAgICAgICAgICAgICBhX0ludGVyZmFjZV9tc2coY29ubi0+ZGQt
PmJ3LCAiJXMiLCBEYXRhMSk7CiAgICAgICAgICAgICAgICAgIGFfQm9va21hcmtzX2NoYXRfYWRk
KE5VTEwsIE5VTEwsIERhdGExKTsKIAkJCSAgIGdfZnJlZShEYXRhMV9lbmMpOwogICAgICAgICAg
ICAgfSBlbHNlIGlmIChzdHJjbXAoRGF0YTIsICJkaWFsb2ciKSA9PSAwKSB7Cg==
</data>        

          </attachment>
    </bug>

</bugzilla>