Summary
Treeio through 2.0 insecurely deserializes pickle data stored in an update record's format strings. A staff user able to set that data through the Django admin may cause Python code to run as the web server when news feeds render.
Affected context
The issue occurs in Treeio's UpdateRecord.get_format_strings and ModuleSetting.loads handling of format-string data. Deployments may be at risk when staff can store attacker-controlled data in an UpdateRecord and feed rendering deserializes that data without verification.
Exploit preconditions
- Attack surface: Django admin and news-feed rendering
- Required access: Staff-level access that permits changing an
UpdateRecordformat_strings field, or equivalent ability to alter that data - Trigger point: Rendering a news feed that processes the affected record
- Why exploitation is possible: The application deserializes unverified pickle data, which can cause code execution during processing
Why this happens
The application uses pickle deserialization on data that may be controlled by a staff user. Pickle can reconstruct Python objects and may invoke code as part of deserialization, so it is unsafe for untrusted or insufficiently trusted input. This is CWE-502: Deserialization of Untrusted Data.
Potential impact
- Python code may execute with the web server process's permissions
- Application data or secrets accessible to that process could be exposed or altered
- The application may be disrupted or used as a foothold for further activity, depending on its privileges and environment
General mitigation guidance
Mitigation patterns include removing pickle from paths that process user-controlled or staff-editable data and choosing a data format that does not execute code during parsing. Treat administrative input as untrusted, validate it against a strict schema, and apply authorization checks to changes that affect feed rendering. Run the web server with least privilege and limit its access to secrets, files, and network resources.
How teams detect issues like this
Review code for pickle deserialization and trace whether the data can be influenced through administrative interfaces or other input paths. Use static analysis rules to flag pickle loading and code review checks to verify trust boundaries and authorization around stored feed data. Policy checks can disallow unsafe deserialization in application code and require schema validation for persisted input.

