rpms/kdelibs/devel kdelibs-4.2.98-cve-2009-1687.patch, NONE, 1.1 kdelibs-4.2.98-cve-2009-1698.patch, NONE, 1.1 kdelibs-4.2.98-cve-2009-1725.patch, NONE, 1.1 kdelibs-4.2.98-cve-2009-2537-select-length.patch, NONE, 1.1 kdelibs.spec, 1.493, 1.494

Kevin Kofler kkofler at fedoraproject.org
Sun Jul 26 02:25:44 UTC 2009


Author: kkofler

Update of /cvs/pkgs/rpms/kdelibs/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24395/devel

Modified Files:
	kdelibs.spec 
Added Files:
	kdelibs-4.2.98-cve-2009-1687.patch 
	kdelibs-4.2.98-cve-2009-1698.patch 
	kdelibs-4.2.98-cve-2009-1725.patch 
	kdelibs-4.2.98-cve-2009-2537-select-length.patch 
Log Message:
* Sun Jul 26 2009 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.2.98-3
- fix CVE-2009-2537 - select length DoS
- fix CVE-2009-1725 - crash, possible ACE in numeric character references
- fix CVE-2009-1687 - possible ACE in KJS (FIXME: now aborts, so still crashes)
- fix CVE-2009-1698 - crash, possible ACE in CSS style attribute handling

kdelibs-4.2.98-cve-2009-1687.patch:
 collector.cpp |    4 ++++
 1 file changed, 4 insertions(+)

--- NEW FILE kdelibs-4.2.98-cve-2009-1687.patch ---
diff -ur kdelibs-4.2.98/kjs/collector.cpp kdelibs-4.2.98-cve-2009-1687/kjs/collector.cpp
--- kdelibs-4.2.98/kjs/collector.cpp	2009-04-30 20:02:44.000000000 +0200
+++ kdelibs-4.2.98-cve-2009-1687/kjs/collector.cpp	2009-07-26 03:52:44.000000000 +0200
@@ -31,6 +31,7 @@
 #include "value.h"
 
 #include <setjmp.h>
+#include <limits.h>
 #include <algorithm>
 
 #if PLATFORM(DARWIN)
@@ -109,6 +110,9 @@
 
     void append(CollectorBlock* block) {
         if (m_used == m_capacity) {
+            static const size_t maxNumBlocks = ULONG_MAX / sizeof(CollectorBlock*) / GROWTH_FACTOR;
+            if (m_capacity > maxNumBlocks)
+                CRASH();
             m_capacity = max(MIN_ARRAY_SIZE, m_capacity * GROWTH_FACTOR);
             m_data = static_cast<CollectorBlock **>(fastRealloc(m_data, m_capacity * sizeof(CollectorBlock *)));
         }

kdelibs-4.2.98-cve-2009-1698.patch:
 css_valueimpl.cpp |    4 +++-
 cssparser.cpp     |   11 ++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

--- NEW FILE kdelibs-4.2.98-cve-2009-1698.patch ---
diff -ur kdelibs-4.2.98/khtml/css/cssparser.cpp kdelibs-4.2.98-cve-2009-1698/khtml/css/cssparser.cpp
--- kdelibs-4.2.98/khtml/css/cssparser.cpp	2009-07-21 17:16:12.000000000 +0200
+++ kdelibs-4.2.98-cve-2009-1698/khtml/css/cssparser.cpp	2009-07-26 04:19:38.000000000 +0200
@@ -1513,6 +1513,14 @@
                 if ( args->size() != 1)
                     return false;
                 Value *a = args->current();
+                if (a->unit != CSSPrimitiveValue::CSS_IDENT) {
+                    isValid=false;
+                    break;
+                }
+                if (qString(a->string)[0] == '-') {
+                    isValid=false;
+                    break;
+                }
                 parsedValue = new CSSPrimitiveValueImpl(domString(a->string), CSSPrimitiveValue::CSS_ATTR);
             }
             else
@@ -1565,7 +1573,8 @@
 
     CounterImpl *counter = new CounterImpl;
     Value *i = args->current();
-//    if (i->unit != CSSPrimitiveValue::CSS_IDENT) goto invalid;
+    if (i->unit != CSSPrimitiveValue::CSS_IDENT) goto invalid;
+    if (qString(i->string)[0] == '-') goto invalid;
     counter->m_identifier = domString(i->string);
     if (counters) {
         i = args->next();
diff -ur kdelibs-4.2.98/khtml/css/css_valueimpl.cpp kdelibs-4.2.98-cve-2009-1698/khtml/css/css_valueimpl.cpp
--- kdelibs-4.2.98/khtml/css/css_valueimpl.cpp	2009-05-14 19:27:35.000000000 +0200
+++ kdelibs-4.2.98-cve-2009-1698/khtml/css/css_valueimpl.cpp	2009-07-26 04:17:28.000000000 +0200
@@ -1212,7 +1212,9 @@
 	    text = getValueName(m_value.ident);
 	    break;
 	case CSSPrimitiveValue::CSS_ATTR:
-	    // ###
+            text = "attr(";
+            text += DOMString( m_value.string );
+            text += ")";
 	    break;
 	case CSSPrimitiveValue::CSS_COUNTER:
             text = "counter(";

kdelibs-4.2.98-cve-2009-1725.patch:
 htmltokenizer.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE kdelibs-4.2.98-cve-2009-1725.patch ---
Index: khtml/html/htmltokenizer.cpp
===================================================================
--- khtml/html/htmltokenizer.cpp	(revision 1002162)
+++ khtml/html/htmltokenizer.cpp	(revision 1002163)
@@ -1038,7 +1038,7 @@
 #ifdef TOKEN_DEBUG
                 kDebug( 6036 ) << "unknown entity!";
 #endif
-                checkBuffer(10);
+                checkBuffer(11);
                 // ignore the sequence, add it to the buffer as plaintext
                 *dest++ = '&';
                 for(unsigned int i = 0; i < cBufferPos; i++)

kdelibs-4.2.98-cve-2009-2537-select-length.patch:
 kjs_html.cpp |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

--- NEW FILE kdelibs-4.2.98-cve-2009-2537-select-length.patch ---
Index: khtml/ecma/kjs_html.cpp
===================================================================
--- khtml/ecma/kjs_html.cpp	(revision 1001151)
+++ khtml/ecma/kjs_html.cpp	(revision 1001152)
@@ -69,6 +69,9 @@
 #include <QtCore/QList>
 #include <QtCore/QHash>
 
+// CVE-2009-2537 (vendors agreed on max 10000 elements)
+#define MAX_SELECT_LENGTH 10000
+
 using namespace DOM;
 
 namespace KJS {
@@ -2454,8 +2457,12 @@
       case SelectValue:           { select.setValue(str.implementation()); return; }
       case SelectLength:          { // read-only according to the NS spec, but webpages need it writeable
                                          JSObject *coll = getSelectHTMLCollection(exec, select.options(), &select)->getObject();
+
                                          if ( coll )
-                                           coll->put(exec,"length",value);
+                                           if (value->toInteger(exec) >= MAX_SELECT_LENGTH)
+                                             setDOMException(exec, DOMException::INDEX_SIZE_ERR);
+                                           else
+                                             coll->put(exec, "length", value);
                                          return;
                                        }
       // read-only: form


Index: kdelibs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdelibs/devel/kdelibs.spec,v
retrieving revision 1.493
retrieving revision 1.494
diff -u -p -r1.493 -r1.494
--- kdelibs.spec	25 Jul 2009 16:58:35 -0000	1.493
+++ kdelibs.spec	26 Jul 2009 02:25:44 -0000	1.494
@@ -5,7 +5,7 @@
 
 Summary: K Desktop Environment 4 - Libraries
 Version: 4.2.98
-Release: 2%{?dist}
+Release: 3%{?dist}
 
 %if 0%{?fedora} > 8
 Name: kdelibs
@@ -84,6 +84,15 @@ Patch20: kdelibs-4.1.70-cmake.patch
 
 # upstream
 # 4.3 branch
+# fix CVE-2009-2537 - select length DoS
+Patch100: kdelibs-4.2.98-cve-2009-2537-select-length.patch
+# fix CVE-2009-1725 - crash, possible ACE in numeric character references
+Patch101: kdelibs-4.2.98-cve-2009-1725.patch
+### I will upstream these ones if the build completes successfully. -- kkofler
+# fix CVE-2009-1687 - possible ACE in KJS (FIXME: now aborts, so still crashes)
+Patch102: kdelibs-4.2.98-cve-2009-1687.patch
+# fix CVE-2009-1698 - crash, possible ACE in CSS style attribute handling
+Patch103: kdelibs-4.2.98-cve-2009-1698.patch
 
 BuildRequires: qt4-devel >= 4.4.0
 # qt4%{_?_isa} isn't provided yet -- Rex
@@ -215,6 +224,10 @@ sed -i -e "s|@@VERSION_RELEASE@@|%{versi
 
 # upstream patches
 # 4.3
+%patch100 -p0 -b .cve-2009-2537
+%patch101 -p0 -b .cve-2009-1725
+%patch102 -p0 -b .cve-2009-1687
+%patch103 -p0 -b .cve-2009-1698
 
 
 %build
@@ -397,6 +410,12 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Sun Jul 26 2009 Kevin Kofler <Kevin at tigcc.ticalc.org> - 4.2.98-3
+- fix CVE-2009-2537 - select length DoS
+- fix CVE-2009-1725 - crash, possible ACE in numeric character references
+- fix CVE-2009-1687 - possible ACE in KJS (FIXME: now aborts, so still crashes)
+- fix CVE-2009-1698 - crash, possible ACE in CSS style attribute handling
+
 * Fri Jul 24 2009 Lukáš Tinkl <ltinkl at redhat.com> - 4.2.98-2
 - respun tarball, to fix KIO HTTP redirects
 - fix phonon/strigi versions




More information about the fedora-extras-commits mailing list