Summary
labbench's read() and read_relational() functions may pass files with .p or .pickle extensions to pandas.read_pickle(), which can execute code while loading crafted data. The risk arises when an attacker can supply a file or relational data archive that a user then loads with either function.
Affected context
The vulnerability affects labbench data-loading paths that select the pickle parser based on a file extension alone. It becomes risky when an untrusted or attacker-supplied .p or .pickle file, including a relational data archive, is loaded through read() or read_relational().
Exploit preconditions
- Attack surface: File or relational archive loading through labbench.
- Required access: The attacker must be able to supply or influence a file that a user or process can access.
- Trigger point: A user or process loads the crafted file using
read()orread_relational(). - Why exploitation is possible: The extension alone can route the file to
pandas.read_pickle(), which can execute code during deserialization.
Why this happens
The code selects a deserialization mechanism based on a filename extension without establishing that the file is trusted. Pickle deserialization can invoke executable behavior during object reconstruction, so processing attacker-controlled data this way maps to CWE-502: Deserialization of Untrusted Data.
Potential impact
- Arbitrary code may execute in the process loading the file.
- An attacker could gain access to data or resources available to that process.
- The integrity of the host application or its outputs could be compromised.
General mitigation guidance
Defensive approaches focus on avoiding executable serialization formats at trust boundaries.
- Prefer non-executable data formats with explicit schemas for untrusted inputs.
- Do not treat a filename extension as evidence that a file is safe to deserialize.
- Restrict pickle-based loading to data from verified, trusted sources.
- Apply strict input validation and limit the permissions and resources available to data-loading processes.
How teams detect issues like this
- Use static analysis to identify calls to
pandas.read_pickle()and other pickle deserialization APIs, especially when reached through extension-based dispatch. - Review data-loading code for assumptions that file extensions establish content safety or trust.
- Enforce policies that prohibit pickle parsing for untrusted inputs and require approved formats at ingestion boundaries.
- Automated code review tools can help flag deserialization paths for further assessment.

