~ubuntu-branches/debian/wheezy/kdelibs/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/CVE-2009-2702.diff

  • Committer: Bazaar Package Importer
  • Author(s): Giuseppe Iuculano
  • Date: 2009-10-14 09:57:26 UTC
  • Revision ID: james.westby@ubuntu.com-20091014095726-ihp29zip0uranw46
Tags: 4:3.5.10.dfsg.1-2.1
* Non-maintainer upload by the testing Security Team.
* Fixed CVE-2009-1687: An integer overflow, leading to heap-based buffer
  overflow was found in the KDE implementation of garbage collector for the
  JavaScript language (KJS).
* Fixed CVE-2009-1690: KDE HTML parser incorrectly handled content, forming
  the HTML page <head> element. A remote attacker could use this flaw to
  cause a denial of service (konqueror crash) or, potentially, execute
  arbitrary code, with the privileges of the user running "konqueror" web
  browser, if the victim was tricked to open a specially-crafted HTML page.
  (Closes: #534949)
* Fixed CVE-2009-1698: KDE's Cascading Style Sheets (CSS) parser incorrectly
  handled content, forming the value of CSS "style" attribute. A remote
  attacker could use this flaw to cause a denial of service (konqueror crash)
  or potentially execute arbitrary code with the privileges of the user
  running "konqueror" web browser, if the victim visited a specially-crafted
  CSS equipped HTML page. (Closes: #534949)
* Fixed CVE-2009-2702: KDE KSSL in kdelibs 3.5.4, 4.2.4, and 4.3 does not
  properly handle a '\0' character in a domain name in the Subject
  Alternative Name field of an X.509 certificate, which allows
  man-in-the-middle attackers to spoof arbitrary SSL servers via a crafted
  certificate issued by a legitimate Certification Authority (Closes: #546212) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Description: Fix parsing of Subject Alternate Names in kssl (CVE-2009-2702)
 
3
# Patch: https://bugzilla.redhat.com/show_bug.cgi?id=520661
 
4
#
 
5
diff -Nur -x '*.orig' -x '*~' kdelibs-3.5.10.dfsg.1/kio/kssl/kopenssl.cc kdelibs-3.5.10.dfsg.1.new/kio/kssl/kopenssl.cc
 
6
--- kdelibs-3.5.10.dfsg.1/kio/kssl/kopenssl.cc  2006-07-22 03:16:39.000000000 -0500
 
7
+++ kdelibs-3.5.10.dfsg.1.new/kio/kssl/kopenssl.cc      2009-09-15 14:53:49.052000619 -0500
 
8
@@ -196,6 +196,7 @@
 
9
 static X509_NAME *(*K_X509_NAME_new)() = 0L;
 
10
 static int (*K_X509_REQ_set_subject_name)(X509_REQ*,X509_NAME*) = 0L;
 
11
 static unsigned char *(*K_ASN1_STRING_data)(ASN1_STRING*) = 0L;
 
12
+static int (*K_ASN1_STRING_length)(ASN1_STRING*) = 0L;
 
13
 static STACK_OF(SSL_CIPHER) *(*K_SSL_get_ciphers)(const SSL *ssl) = 0L;
 
14
 
 
15
 #endif
 
16
@@ -494,6 +495,7 @@
 
17
       K_X509_NAME_new = (X509_NAME *(*)()) _cryptoLib->symbol("X509_NAME_new");
 
18
       K_X509_REQ_set_subject_name = (int (*)(X509_REQ*,X509_NAME*)) _cryptoLib->symbol("X509_REQ_set_subject_name");
 
19
       K_ASN1_STRING_data = (unsigned char *(*)(ASN1_STRING*)) _cryptoLib->symbol("ASN1_STRING_data");
 
20
+      K_ASN1_STRING_length = (int (*)(ASN1_STRING*)) _cryptoLib->symbol("ASN1_STRING_length");
 
21
 #endif
 
22
    }
 
23
 
 
24
@@ -1545,6 +1547,13 @@
 
25
    return 0L;
 
26
 }
 
27
 
 
28
+
 
29
+int KOpenSSLProxy::ASN1_STRING_length(ASN1_STRING *x) {
 
30
+   if (K_ASN1_STRING_length) return (K_ASN1_STRING_length)(x);
 
31
+   return 0L;
 
32
+}
 
33
+
 
34
+
 
35
 STACK_OF(SSL_CIPHER) *KOpenSSLProxy::SSL_get_ciphers(const SSL* ssl) {
 
36
   if (K_SSL_get_ciphers) return (K_SSL_get_ciphers)(ssl);
 
37
   return 0L;
 
38
diff -Nur -x '*.orig' -x '*~' kdelibs-3.5.10.dfsg.1/kio/kssl/kopenssl.h kdelibs-3.5.10.dfsg.1.new/kio/kssl/kopenssl.h
 
39
--- kdelibs-3.5.10.dfsg.1/kio/kssl/kopenssl.h   2006-07-22 03:16:39.000000000 -0500
 
40
+++ kdelibs-3.5.10.dfsg.1.new/kio/kssl/kopenssl.h       2009-09-15 14:53:49.052000619 -0500
 
41
@@ -622,6 +622,11 @@
 
42
    unsigned char *ASN1_STRING_data(ASN1_STRING *x);
 
43
 
 
44
    /*
 
45
+    *  ASN1_STRING_length
 
46
+    */
 
47
+   int ASN1_STRING_length(ASN1_STRING *x);
 
48
+
 
49
+   /*
 
50
     *  
 
51
     */
 
52
    int OBJ_obj2nid(ASN1_OBJECT *o);
 
53
diff -Nur -x '*.orig' -x '*~' kdelibs-3.5.10.dfsg.1/kio/kssl/ksslcertificate.cc kdelibs-3.5.10.dfsg.1.new/kio/kssl/ksslcertificate.cc
 
54
--- kdelibs-3.5.10.dfsg.1/kio/kssl/ksslcertificate.cc   2006-01-19 11:06:12.000000000 -0600
 
55
+++ kdelibs-3.5.10.dfsg.1.new/kio/kssl/ksslcertificate.cc       2009-09-15 14:53:49.059994753 -0500
 
56
@@ -1099,7 +1099,9 @@
 
57
                }
 
58
 
 
59
                QString s = (const char *)d->kossl->ASN1_STRING_data(val->d.ia5);
 
60
-               if (!s.isEmpty()) {
 
61
+               if (!s.isEmpty()  &&
 
62
+                               /* skip subjectAltNames with embedded NULs */
 
63
+                               s.length() == d->kossl->ASN1_STRING_length(val->d.ia5)) {
 
64
                        rc += s;
 
65
                }
 
66
        }