CVE-2026-124318
Insecure deserialization via pickle in Treeio allows staff to execute code.
- CVSS 8.6
- CWE-502
- Design Defects
- Remote
Treeio through 2.0 contains an insecure deserialization vulnerability in UpdateRecord.get_format_strings and ModuleSetting.loads that allows staff users to execute code via unverified pickle data. Attackers can store a crafted base64 pickle payload in an UpdateRecord format_strings field through the Django admin, executing Python code as the web server user when news feeds render.
- CWE
- CWE-502
- CVSS base score
- 8.6
- Published
- 2026-11-07
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Serialization Issues
- Category
- Design Defects
- Subcategory
- Insecure Parsing or Deserialization
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Treeio
Solution
Upgrade Treeio to version 2.1 (or later), which removes the insecure deserialization in UpdateRecord.get_format_strings and ModuleSetting.loads. This patch eliminates the pickle‑based code execution vulnerability.
Vulnerable code sample
import base64
import pickle
from django.db import models
class UpdateRecord(models.Model):
format_strings = models.TextField()
def get_format_strings(self):
# VULNERABLE: untrusted pickle deserialization
raw = base64.b64decode(self.format_strings)
return pickle.loads(raw)
class ModuleSetting(models.Model):
data = models.TextField()
@classmethod
def loads(cls, payload):
# VULNERABLE: insecure pickle.loads on user‑controlled data
raw = base64.b64decode(payload)
return pickle.loads(raw)Patched code sample
import base64
import json
from django.db import models
class UpdateRecord(models.Model):
format_strings = models.TextField()
def get_format_strings(self):
# FIX: replace pickle with safe JSON deserialization
raw = base64.b64decode(self.format_strings)
return json.loads(raw.decode('utf-8'))
class ModuleSetting(models.Model):
data = models.TextField()
@classmethod
def loads(cls, payload):
# FIX: replace pickle with safe JSON deserialization
raw = base64.b64decode(payload)
return json.loads(raw.decode('utf-8'))Cite this entry
@misc{vaitp:cve2026124318,
title = {{Insecure deserialization via pickle in Treeio allows staff to execute code.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-124318},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-124318/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
