Common Vulnerabilities and Exposures assigned an identifier CVE-2007-4965 to the following vulnerability:
Multiple integer overflows in the imageop module in Python 2.5.1 and earlier allow context-dependent attackers to cause a denial of service (application crash) and possibly obtain sensitive information (memory contents) via crafted arguments to (1) the tovideo method, and unspecified other vectors related to (2) imageop.c, (3) rbgimgmodule.c, and other files, which trigger heap-based buffer overflows.
References: http://lists.grok.org.uk/pipermail/full-disclosure/2007-September/065826.html http://www.securityfocus.com/bid/25696
Upstream bug report for the issue: http://bugs.python.org/issue1179
Multiple integer overflows in the PyOSvsnprintf function in Python/mysnprintf.c in Python 2.5.2 and earlier allow context-dependent attackers to cause a denial of service (memory corruption) or have unspecified other impact via crafted input to string formatting operations. NOTE: the handling of certain integer values is also affected by related integer underflows and an off-by-one error.
Multiple integer overflows in Python 2.5.2 and earlier allow context-dependent attackers to have an unknown impact via vectors related to the (1) stringobject, (2) unicodeobject, (3) bufferobject, (4) longobject, (5) tupleobject, (6) stropmodule, (7) gcmodule, and (8) mmapmodule modules. NOTE: The expandtabs integer overflows in stringobject and unicodeobject in 2.5.2 are covered by CVE-2008-5031.
Description of problem:
Modules/localemodule.c:361 356 n1 = strlen(s) + 1; 357 buf = PyMemMalloc(n1); 358 if (!buf) 359 return PyErrNoMemory(); 360 n2 = strxfrm(buf, s, n1);
In case the transformed string is longer than original string... (see the PoC for an exapmle)
361 if (n2 > n1) { 362 / more space needed /
We allocate n2 bytes here:
363 buf = PyMemRealloc(buf, n2); 364 if (!buf) 365 return PyErrNoMemory();
And here the string will be n2 chars long and terminating NUL won't fit and thus the string won't be terminated what can lead to an information leak in certain rare cases (see the original Debian report for details).
366 strxfrm(buf, s, n2); 367 } 368 result = PyStringFromString(buf); 369 PyMemFree(buf); 370 return result; 371 } 372 373 #if defined(MSWINDOWS) 374 static PyObject 375 PyLocalegetdefaultlocale(PyObject self)
Version-Release number of selected component (if applicable):
FC5, FC6, RHEL2.1, RHEL3, RHEL4, RHEL5
How reproducible:
Proof of concept code attached.
Additional info:
See the URL for an original bug report to Debian and PoC by Piotr Engelking. It contains details on how to reproduce and recognize the flaw.
Stack-based buffer overflow in the filecompress function in minigzip (Modules/zlib) in Python 2.5 allows context-dependent attackers to execute arbitrary code via a long file argument.
End of life: 5/26/2011, Latest version: 2.5.6