CVE-2025-56005
ply: python-ply: Unsafe pickle file handling in Ply
Severity
ImportantRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · January 20, 2026
Updated · October 29, 2026
Description
An arbitrary code execution vulnerability was discovered in PLY (Python Lex-Yacc). When an application uses PLY's undocumented picklefile parameter to load cached parser data, the library deserializes the pickle file without validation. If an attacker can supply or modify the pickle file being loaded, they can embed malicious code that executes automatically during the deserialization process, potentially allowing them to run arbitrary commands on the affected system.
Statement
This vulnerability rates as Important rather than Critical because it only affects applications using an undocumented parameter (picklefile) in legacy PLY versions 3.2-3.11, which was designed for an atypical use case (Jython environments with oversized parser tables). Exploitation requires the target application to have explicitly implemented this undocumented parameter in their code and depends on the attacker's ability to influence which pickle file gets loaded—whether through shared directory race conditions, configuration injection, supply chain compromise, or chaining with separate vulnerabilities like file upload or path traversal—making this a conditional, context-dependent vulnerability rather than a universally exploitable critical flaw.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
Exploitation requires an application to explicitly use PLY's undocumented picklefile parameter when calling ply.yacc.yacc() and requires an attacker to be able to supply or modify the pickle file that is loaded. Applications can avoid this issue by not using the undocumented picklefile parameter, which was intended only for an atypical use case (Jython environments with oversized parser tables); applications that do not pass this parameter are not exposed. If cached parser data must be loaded, ensure the pickle file is generated locally by the application and stored in a trusted location that untrusted users cannot write to or replace.
CVSS / CWE
CVSS 3.1 · 7.8CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CWE-502 · Deserialization of Untrusted Data