Developer Tools & Libraries

Remote Code Execution

Insecure Deserialization Leading to Arbitrary Code Execution in datrie.Trie

This vulnerability allows a remote attacker to execute arbitrary code on the target system by tricking a victim into loading a malicious .trie file.

6.3
/ 10
Medium
CVSS v3.1
ADVISORY ID
PS98
PUBLISHED
2026-04-08
CVE IDs
CVE-2026-5659
VENDORS
pytries
PUBLIC EXPLOIT
None indexed
CWE
CWE-502, CWE-20
PRODUCT
datrie
CVSS VECTOR
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L/E:P/RL:X/RC:C
Abstract blurred background with dark tones and smooth gradient waves of blue, purple, and orange hues.
Summary

Overview

The pytries datrie package (up to version 0.8.3) is vulnerable to insecure deserialization due to the unsafe use of pickle.load() in the functions Trie.load(), Trie.read(), and Trie.__setstate__() within the trie file handler component (src/datrie.pyx). When a .trie file is loaded, the library first parses valid trie binary data and then directly passes the remaining file content to pickle.load() without validation.

An attacker can craft a malicious .trie file by appending a specially designed pickle payload after valid trie data. When this file is loaded by a victim application, arbitrary Python code embedded in the pickle payload is executed automatically. This behavior is not visible to the user, as the deserialization is hidden behind a seemingly safe data-loading API.

The vulnerability exists due to the absence of secure deserialization practices, such as validation of input data, use of safe serialization formats, or restriction of allowed object types during deserialization. Notably, the BaseTrie class is not affected, as it does not utilize pickle for data loading.

Vulnerability details

Vulnerability details

CVE-2026-5659
CWE-502, CWE-20
Medium | 6.3

The pytries datrie package (up to version 0.8.3) is vulnerable to insecure deserialization due to the unsafe use of pickle.load() in the functions Trie.load(), Trie.read(), and Trie.__setstate__() within the trie file handler component (src/datrie.pyx).

Auth:
None (remote, user interaction required)
Impact:
Limited data disclosure, limited data tampering, partial service degradation
Impact

What an attacker can do

This vulnerability allows a remote attacker to execute arbitrary code on the target system by tricking a victim into loading a malicious .trie file. As a result: · Arbitrary Code Execution: Attackers can execute system-level commands on the victim machine during file loading. · Full System Compromise: Successful exploitation can lead to complete compromise of confidentiality, integrity, and availability of the system. · Supply Chain Risk: Applications relying on external or third-party .trie files may unknowingly introduce malicious payloads into trusted environments. · Data Exfiltration and Manipulation: Attackers can access, modify, or delete sensitive data depending on execution privileges. · Persistence and Backdoors: Malicious payloads can establish persistence mechanisms or install backdoors for long-term access. The attack can be performed remotely without authentication but requires user interaction (loading a malicious file), significantly increasing the risk in real-world scenarios where untrusted files are processed.

DISCLOSURE

Disclosure timeline

2026-03-21 Vulnerability Discovered

2026-03-21 Reported to Vendor

2026-04-06 CVE ID Assigned

2026-04-06 CVE Published

Credits

Dhabaleshwar Das – Payatu Security Consulting Pvt. Ltd.