{"id":"PSF-2017-6","summary":"PyString_DecodeEscape integer overflow","details":"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)","aliases":["CVE-2017-1000158"],"modified":"2026-05-18T23:10:00.022653Z","published":"2017-11-17T00:00:00Z","database_specific":{"cwe_ids":[]},"references":[{"type":"REPORT","url":"https://bugs.python.org/issue30657"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/python/cpython","events":[{"introduced":"0"},{"fixed":"6c004b40f9d51872d848981ef1a18bb08c2dfc42"},{"fixed":"c3c9db89273fabc62ea1b48389d9a3000c1c03ae"},{"fixed":"fd8614c5c5466a14a945db5b059c10c0fb8f76d9"}]}],"versions":["v3.4.7","v3.5.4","v3.5.4rc1","v3.4.7rc1","v3.4.6","v3.5.3","v3.5.3rc1","v3.4.6rc1","v2.7.13rc1","v3.4.5","v3.5.2","v3.4.5rc1","v3.5.2rc1","v2.7.12rc1","v3.5.1rc1","v2.7.11rc1","v3.5.0rc3","v3.5.0rc2","v3.5.0rc1","v3.5.0b4","v3.5.0b3","v3.5.0b1","v2.7.10rc1","v3.5.0a4","v3.5.0a3","v3.5.0a2","v3.4.3","v3.5.0a1","v3.4.3rc1","v2.7.9rc1","v3.4.2rc1","v2.7.8","v3.4.1","v3.4.1rc1","v3.4.0","v3.4.0rc3","v3.4.0rc2","v3.4.0rc1","v3.4.0b3","v3.4.0b2","v3.4.0b1","v2.7.6rc1","v3.4.0a4","v3.4.0a3","v3.4.0a2","v3.4.0a1","v2.7.5","v2.7.4rc1","v3.3.0rc3","v3.3.0rc2","v3.3.0rc1","v3.3.0b2","v3.3.0b1","v3.3.0a4","v3.3.0a3","v3.3.0a2","v2.7.3rc1","v2.7.2rc1","v2.7","v3.2rc3","v3.2rc2","v3.2rc1","v3.2b2","v3.2b1","v2.7.1","v2.7.1rc1","v3.2a4","v3.2a3","v3.2a2","v3.2a1","v2.7rc2","v2.7rc1","v2.7b2","v2.7b1","v2.7a4","v2.7a3","v2.7a2","v2.7a1","v3.1","v3.1rc2","v3.1rc1","v3.1b1","v3.1a2","v3.1a1","v3.0rc3","v3.0rc2","v2.6","v2.6rc2","v3.0rc1","v2.6rc1","v3.0b3","v2.6b3","v2.6b2","v3.0b2","v2.6b1","v3.0b1","v2.6a3","v3.0a5","v2.6a2","v3.0a4","v3.0a3","v2.6a1","v3.0a2","v3.0a1","v2.5b3","v2.5b2","v2.5b1","v2.5a2","v2.5a1","v2.5a0","v2.4","v2.4c1","v2.4b2","v2.4b1","v2.4a3","v2.4a2","v2.4a1","v2.3c2","v2.3c1","v2.2a3","v2.1","v2.1c2","v2.1c1","v2.1b2","v2.1b1","v2.1a2","v2.1a1","v2.0","v2.0c1","v2.0b2","v2.0b1","v1.6a2","v1.6a1","v1.5.2","v1.5.2c1","v1.5.2b2","v1.5.2b1","v1.5.2a2","v1.5.2a1","v1.5.1","v1.5","v1.5b2","v1.5b1","v1.5a4","v1.5a3","v1.5a2","v1.5a1","v1.4","v1.4b3","v1.4b2","v1.4b1","v1.3","v1.3b1","v1.2","v1.2b4","v1.2b3","v1.2b2","v1.2b1","v1.1.1","v1.1","v1.0.2","v1.0.1","v0.9.9","v0.9.8"],"database_specific":{"vanir_signatures":[{"id":"PSF-2017-6-31d05647","signature_version":"v1","digest":{"function_hash":"31179806471181117326004825060400939616","length":2974},"deprecated":false,"source":"https://github.com/python/cpython/commit/fd8614c5c5466a14a945db5b059c10c0fb8f76d9","target":{"function":"PyBytes_DecodeEscape","file":"Objects/bytesobject.c"},"signature_type":"Function"},{"id":"PSF-2017-6-439f8402","signature_version":"v1","digest":{"threshold":0.9,"line_hashes":["264698812612038223625738423785275396491","324901092193929762203901685244255787472","289276965729970537948574322186833225808","175115093422823433934398045905321445710"]},"deprecated":false,"source":"https://github.com/python/cpython/commit/c3c9db89273fabc62ea1b48389d9a3000c1c03ae","target":{"file":"Objects/stringobject.c"},"signature_type":"Line"},{"id":"PSF-2017-6-7d346928","signature_version":"v1","digest":{"function_hash":"64170048644253513690968698989059040609","length":3243},"deprecated":false,"source":"https://github.com/python/cpython/commit/c3c9db89273fabc62ea1b48389d9a3000c1c03ae","target":{"function":"PyString_DecodeEscape","file":"Objects/stringobject.c"},"signature_type":"Function"},{"id":"PSF-2017-6-a13d6c73","signature_version":"v1","digest":{"function_hash":"31179806471181117326004825060400939616","length":2974},"deprecated":false,"source":"https://github.com/python/cpython/commit/6c004b40f9d51872d848981ef1a18bb08c2dfc42","target":{"function":"PyBytes_DecodeEscape","file":"Objects/bytesobject.c"},"signature_type":"Function"},{"id":"PSF-2017-6-b814d76f","signature_version":"v1","digest":{"threshold":0.9,"line_hashes":["264698812612038223625738423785275396491","49225347790879069755109775863064602465","56373801459327902970855607913023796643","141892281464176794472381829000867063416"]},"deprecated":false,"source":"https://github.com/python/cpython/commit/fd8614c5c5466a14a945db5b059c10c0fb8f76d9","target":{"file":"Objects/bytesobject.c"},"signature_type":"Line"},{"id":"PSF-2017-6-f7c09a2a","signature_version":"v1","digest":{"threshold":0.9,"line_hashes":["264698812612038223625738423785275396491","49225347790879069755109775863064602465","56373801459327902970855607913023796643","141892281464176794472381829000867063416"]},"deprecated":false,"source":"https://github.com/python/cpython/commit/6c004b40f9d51872d848981ef1a18bb08c2dfc42","target":{"file":"Objects/bytesobject.c"},"signature_type":"Line"}],"source":"https://github.com/psf/advisory-database/blob/main/advisories/python/PSF-2017-6.json","vanir_signatures_modified":"2026-05-18T23:10:00Z"}}],"schema_version":"1.7.5"}