]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixes Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes
authorGregory P. Smith <greg@krypto.org>
Wed, 14 Mar 2012 21:41:00 +0000 (14:41 -0700)
committerGregory P. Smith <greg@krypto.org>
Wed, 14 Mar 2012 21:41:00 +0000 (14:41 -0700)
in the hash table internal to the pyexpat module's copy of the expat
library to avoid a denial of service due to hash collisions.
Patch by David Malcolm with some modifications by the expat project.

1  2 
Misc/NEWS
Modules/pyexpat.c

diff --cc Misc/NEWS
index 6d6268c4c8c1bba4e34a7f905cc3faf4024bfb8b,88ef91ead0afbfae0b902d45d5619cda02d7bde2..1b4e09fceaea6f2332b3b1422f61807f2e7b5fcb
+++ b/Misc/NEWS
@@@ -65,14 -48,12 +65,27 @@@ Librar
  Extension Modules
  -----------------
  
 -- Issue #12221: Replace pyexpat.__version__ with the Python version.
 +- Issue #14212: The re module didn't retain a reference to buffers it was
 +  scanning, resulting in segfaults.
 +
 +
++What's New in Python 3.2.3 release candidate 2?
++===============================================
++
++*Release date: XX-Mar-2012*
++
++Library
++-------
++
++- Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes in the hash
++  table internal to the pyexpat module's copy of the expat library to avoid a
++  denial of service due to hash collisions.  Patch by David Malcolm with some
++  modifications by the expat project.
 -What's New in Python 3.1.4 release candidate 1?
 +What's New in Python 3.2.3 release candidate 1?
  ===============================================
  
- *Release date: 24-Feb-2011*
 -*Release date: 2011-05-29*
++*Release date: 24-Feb-2012*
  
  Core and Builtins
  -----------------
index 849423f96bde44747f905a5f523bb58c775f7d6d,3ff56f4166ff98bad442312eede3789843957daa..c1142de54dc106d89b8f11121c71fb4e2129a040
@@@ -1150,9 -1245,15 +1150,11 @@@ newxmlparseobject(char *encoding, char 
      else {
          self->itself = XML_ParserCreate(encoding);
      }
+     XML_SetHashSalt(self->itself,
+                     (unsigned long)_Py_HashSecret.prefix);
      self->intern = intern;
      Py_XINCREF(self->intern);
 -#ifdef Py_TPFLAGS_HAVE_GC
      PyObject_GC_Track(self);
 -#else
 -    PyObject_GC_Init(self);
 -#endif
      if (self->itself == NULL) {
          PyErr_SetString(PyExc_RuntimeError,
                          "XML_ParserCreate failed");