T09 · Insecure Skill Coding Practices
- Location
scripts/file_connector.py:128- Finding
Unsafe Pickle Deserialization Allows Arbitrary Code Execution
- Content
View full analysis
pd.DataFrame: return pd.read_pickle(path, **kwargs) ``` ### Technical Analysis `pandas.read_pickle()` uses Python pickle deserialization. Pickle is an executable serialization format: a crafted object can invoke arbitrary callables through methods such as `__reduce__` during loading. The connector treats `.pkl` and `.pickle` files as ordinary supported data files without a trust check, warning, signature verification, or explicit unsafe-format opt-in. Consequently, merely loading an attacker-supplied file can execute code before a DataFrame is returned. ### Attack Path 1. An attacker creates a malicious pickle whose deserialization gadget runs an operating-system command or arbitrary Python code. 2. The attacker supplies the file to a user or places it in a directory processed by the Skill. 3. The Agent invokes `FileConnector`, `load_file()`, or a pipeline method on that file. 4. Extension dispatch selects `_load_pickle()`. 5. `pd.read_pickle()` deserializes the payload and executes the embedded callable. 6. The payload runs with the same operating-system identity and permissions as the Agent process. ### Impact Assessment Successful exploitation provides arbitrary code execution under the Agent process account. The attacker could read or modify files accessible to that account, access environment variables and database credentials, tamper with generated reports, invoke network connections, or compromise subsequent pipeline operations. The vulnerability does not itself elevate operating-system privileges, but it inherits all privileges available to the Skill runtime. ]]>- Remediation
View remediation
