Junglewise Threat Intelligence

CVE-2025-56005: PLY Python Lex-Yacc remote code execution via undocumented picklefile parameter

CVE-2025-56005 · Severity: critical · CVSS 9.8 · Published 2026-01-20

Executive brief

PLY (Python Lex-Yacc) is a popular Python library used by developers to build compilers and parsers. An undocumented feature in the library allows it to load configuration files (pickle files) that can contain hidden, malicious code. If an application using this library is tricked into loading a malicious file, an attacker can take complete control of the system, potentially leading to data theft or service disruption.

Technical details

A vulnerability exists in the PyPI distribution of PLY 3.11 due to the presence of an undocumented 'picklefile' parameter in the 'yacc()' function. This parameter triggers the 'LRTable.read_pickle()' method, which utilizes 'pickle.load()' to deserialize data without any validation. Because the Python 'pickle' module is inherently unsafe and allows for arbitrary code execution via the '__reduce__' method, an attacker who can provide or influence the path to a '.pkl' file can achieve full code execution. The vulnerability is triggered during parser initialization, before any actual parsing logic occurs. While some third parties have disputed the exploitability based on specific PoC failures, the root cause (CWE-502) remains present in the library's code.

Affected products

  • PLY Project PLY (Python Lex-Yacc) 3.11

Timeline

  • 2025-07-01: disclosed: Initial discovery reported by Ahmed Abd
  • 2026-01-20: advisory: CVE-2025-56005 published

References