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
Buffer overflow in the repr function in Python 2.3 through 2.6 before 20060822 allows context-dependent attackers to cause a denial of service and possibly execute arbitrary code via crafted wide character UTF-32/UCS-4 strings to certain scripts.
Common Vulnerabilities and Exposures assigned an identifier CVE-2006-1542 to the following vulnerability:
Stack-based buffer overflow in Python 2.4.2 and earlier, running on Linux 2.6.12.5 under gcc 4.0.3 with libc 2.3.5, allows local users to cause a " stack overflow, " and possibly gain privileges, by running a script from a current working directory that has a long name, related to the realpath function. NOTE: this might not be a vulnerability. However, the fact that it appears in a programming language interpreter could mean that some applications are affected, although attack scenarios might be limited because the attacker might already need to cross privilege boundaries to cause an exploitable program to be placed in a directory with a long name; or, depending on the method that Python uses to determine the current working directory, setuid applications might be affected.
References:
http://milw0rm.com/exploits/1591 http://www.gotfault.net/research/exploit/gexp-python.py
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.
Multiple integer overflows in imageop.c in Python before 2.5.3 allow context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via crafted images that trigger heap-based buffer overflows. NOTE: this issue is due to an incomplete fix for CVE-2007-4965.
The SimpleXMLRPCServer library module in Python 2.2, 2.3 before 2.3.5, and 2.4, when used by XML-RPC servers that use the registerinstance method to register an object without a dispatch method, allows remote attackers to read or modify globals of the associated module, and possibly execute arbitrary code, via dotted attributes.
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.
End of life: 12/19/2008, Latest version: 2.4.6