.. _pystring_decodeescape-integer-overflow: PyString_DecodeEscape integer overflow ====================================== .. warning:: This resource is maintained for historical reference and **does not contain the latest vulnerability info for Python**. The `canonical database for vulnerabilities affecting Python `_ is available on GitHub in the Open Source Vulnerability (OSV) format. This vulnerability can be viewed online at the `Open Source Vulnerability Database `_. Check & prevent integer overflow in PyString_DecodeEscape. You need to compile a 1 GiB Python file on 32-bit system for reproducing it. It is very unlikely that this can happen by accident, and it is hard to used it in security attack. If you can make the attacked program compiling a 1 GiB Python file, you perhaps have easier ways to make a harm. Dates: * Disclosure date: **2017-06-13** (Python issue bpo-30657 reported) Fixed In -------- * Python **2.7.14** (2017-09-16) fixed by `commit c3c9db8 (branch 2.7) `_ (2017-06-18) * Python **3.4.8** (2018-02-04) fixed by `commit 6c004b4 (branch 3.4) `_ (2017-12-08) * Python **3.5.5** (2018-02-04) fixed by `commit fd8614c (branch 3.5) `_ (2017-12-08) Python issue ------------ [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape. * Python issue: `bpo-30657 `_ * Creation date: 2017-06-13 * Reporter: Jay Bosamiya CVE-2017-1000158 ---------------- CPython (aka Python) up to 2.7.13 is vulnerable to an integer overflow in the PyString_DecodeEscape function in stringobject.c, resulting in heap-based buffer overflow (and possible arbitrary code execution) * CVE ID: `CVE-2017-1000158 `_ * Published: 2017-11-17 * `CVSS Score `_: 7.5 Timeline -------- Timeline using the disclosure date **2017-06-13** as reference: * 2017-06-13: `Python issue bpo-30657 `_ reported by Jay Bosamiya * 2017-06-18 (**+5 days**): `commit c3c9db8 (branch 2.7) `_ * 2017-09-16 (**+95 days**): Python 2.7.14 released * 2017-11-17 (**+157 days**): CVE-2017-1000158 published * 2017-12-08 (**+178 days**): `commit 6c004b4 (branch 3.4) `_ * 2017-12-08 (**+178 days**): `commit fd8614c (branch 3.5) `_ * 2018-02-04 (**+236 days**): Python 3.4.8 released * 2018-02-04 (**+236 days**): Python 3.5.5 released