GHSA-5qwp-399c-mjwf: Picklescan has a missing detection when calling built-in python trace.Trace.run
N/A
Basic Information
Technical Details
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| picklescan | pip | < 0.0.29 | 0.0.29 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability GHSA-5qwp-399c-mjwf describes a missing detection in picklescan for the built-in Python function trace.Trace.run. The provided commit aecd11be98702caa9ba9b12189d91ad596a36114 directly addresses this issue.
The analysis of the commit shows modifications to src/picklescan/scanner.py, where a dictionary named dangerous_globals is maintained. This dictionary serves as a denylist for functions and modules that are considered unsafe to be present in a pickle file.
The patch adds a new entry for the trace module: "trace": {"Trace.run", "Trace.runctx"}. This indicates that prior to this patch, picklescan was not checking for the usage of Trace.run or Trace.runctx, allowing a specially crafted pickle file to execute arbitrary code using these functions, as demonstrated in the vulnerability's Proof of Concept.
Therefore, the vulnerable functions are the ones that were missing from the detection list. During an exploit, a call to trace.Trace.run (or trace.Trace.runctx) would appear in the runtime profile. The vulnerability itself is the omission in picklescan's scanner logic, which is fixed by explicitly adding these functions to the list of dangerous globals.