/

CVE-2026-120859

Severity:

HIGH RISK

(7.8)

Unsafe Deserialization (CWE-502) in PyMoDAQ Components

CVE-2026-120859

Received

Vulnerability type

Category:

Unsafe Deserialization and Eval Injection

CWE:

CWE-95, CWE-502

Impact:

Arbitrary code execution in the process handling the file

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

PyMoDAQ components can execute arbitrary code when a user opens or browses crafted HDF5, dock-layout, or XML settings files. This can happen when file content is passed to unsafe deserialization or expression-evaluation routines.

PyMoDAQ components can execute arbitrary code when a user opens or browses crafted HDF5, dock-layout, or XML settings files. This can happen when file content is passed to unsafe deserialization or expression-evaluation routines.

Affected context

The issue affects PyMoDAQ before 4.4.13 and the pymodaq_data, pymodaq_gui, and pymodaq_utils packages in the release ranges specified in the advisory: before 5.1.15, 5.2.x before 5.2.14, and 5.3.x before 5.3.10. Risk arises in file-handling paths that deserialize pickled objects from HDF5 string nodes or evaluate expressions in HDF5 attributes and XML settings. The Dashboard Load layout action also processes .dock files through an unpickling path.

The issue affects PyMoDAQ before 4.4.13 and the pymodaq_data, pymodaq_gui, and pymodaq_utils packages in the release ranges specified in the advisory: before 5.1.15, 5.2.x before 5.2.14, and 5.3.x before 5.3.10. Risk arises in file-handling paths that deserialize pickled objects from HDF5 string nodes or evaluate expressions in HDF5 attributes and XML settings. The Dashboard Load layout action also processes .dock files through an unpickling path.

Exploit preconditions

  • Attack surface: User-facing handling of HDF5 files, .dock layout files, or XML settings files
  • Required access: An attacker must be able to provide or influence a crafted file; the description does not indicate that prior access to the application is required
  • Trigger point: A user opens or browses the file, reads the relevant HDF5 node, loads a dashboard layout, or processes the XML settings
  • Why exploitation is possible: The affected code deserializes pickle data or evaluates expressions from file content that may be attacker-controlled
  • Attack surface: User-facing handling of HDF5 files, .dock layout files, or XML settings files
  • Required access: An attacker must be able to provide or influence a crafted file; the description does not indicate that prior access to the application is required
  • Trigger point: A user opens or browses the file, reads the relevant HDF5 node, loads a dashboard layout, or processes the XML settings
  • Why exploitation is possible: The affected code deserializes pickle data or evaluates expressions from file content that may be attacker-controlled

Why this happens

The vulnerability combines unsafe deserialization and expression evaluation. HDF5 string values and .dock file data reach pickle.loads(), which can construct attacker-controlled objects during deserialization (CWE-502). Expressions in HDF5 attributes and XML settings are evaluated by application code, creating an eval-injection weakness (CWE-95). In both cases, file content is treated as trusted executable input rather than constrained data.

The vulnerability combines unsafe deserialization and expression evaluation. HDF5 string values and .dock file data reach pickle.loads(), which can construct attacker-controlled objects during deserialization (CWE-502). Expressions in HDF5 attributes and XML settings are evaluated by application code, creating an eval-injection weakness (CWE-95). In both cases, file content is treated as trusted executable input rather than constrained data.

Potential impact

  • Arbitrary code could run with the permissions of the process handling the file.
  • An attacker may be able to access or alter data available to that process.
  • The affected application or workstation could be compromised when a crafted file is opened.
  • Additional systems or resources could be exposed if the process has broader privileges.
  • Arbitrary code could run with the permissions of the process handling the file.
  • An attacker may be able to access or alter data available to that process.
  • The affected application or workstation could be compromised when a crafted file is opened.
  • Additional systems or resources could be exposed if the process has broader privileges.

General mitigation guidance

Defensive patterns focus on treating all user-provided files as untrusted:

  • Avoid pickle and dynamic expression evaluation for file formats that may contain attacker-controlled data.
  • Prefer non-executable, schema-constrained formats and parsers that do not instantiate arbitrary objects.
  • Validate file structure and expected values before processing, while recognizing that validation alone does not make unsafe deserialization safe.
  • Reduce exposure by limiting which users and workflows can supply files, and handle untrusted files in isolated processes with minimal privileges.
  • Apply least privilege to the application and restrict its access to sensitive files and services.

Defensive patterns focus on treating all user-provided files as untrusted:

  • Avoid pickle and dynamic expression evaluation for file formats that may contain attacker-controlled data.
  • Prefer non-executable, schema-constrained formats and parsers that do not instantiate arbitrary objects.
  • Validate file structure and expected values before processing, while recognizing that validation alone does not make unsafe deserialization safe.
  • Reduce exposure by limiting which users and workflows can supply files, and handle untrusted files in isolated processes with minimal privileges.
  • Apply least privilege to the application and restrict its access to sensitive files and services.

How teams detect issues like this

  • Use static analysis to identify pickle.loads() and dynamic evaluation of values originating from files or other untrusted sources.
  • Review HDF5, dock-layout, and XML parsing paths for deserialization or evaluation that occurs before effective validation.
  • Add code-review checks for executable serialization formats and for data flows from user-supplied files into interpreters or object constructors.
  • Enforce policies that prohibit unsafe deserialization and expression evaluation in file-processing code; automated review tools can help flag these patterns.
  • Use static analysis to identify pickle.loads() and dynamic evaluation of values originating from files or other untrusted sources.
  • Review HDF5, dock-layout, and XML parsing paths for deserialization or evaluation that occurs before effective validation.
  • Add code-review checks for executable serialization formats and for data flows from user-supplied files into interpreters or object constructors.
  • Enforce policies that prohibit unsafe deserialization and expression evaluation in file-processing code; automated review tools can help flag these patterns.

Frequently asked

questions

The described trigger involves a user opening or processing a crafted file. The description does not establish a network-based attack path, so exposure depends on how files are supplied and handled.

An attacker needs a way to provide or influence a crafted file and have it processed by a user or application workflow. Direct access to the target process is not specified as a prerequisite.

Avoid deserializing untrusted pickle data and evaluating expressions from files. Use constrained data formats and parsers, with validation and isolation as additional safeguards.

Treat files as untrusted input, review file-to-interpreter data flows, enforce policies against unsafe deserialization and dynamic evaluation, and run file processing with minimal privileges.

The described trigger involves a user opening or processing a crafted file. The description does not establish a network-based attack path, so exposure depends on how files are supplied and handled.

An attacker needs a way to provide or influence a crafted file and have it processed by a user or application workflow. Direct access to the target process is not specified as a prerequisite.

Avoid deserializing untrusted pickle data and evaluating expressions from files. Use constrained data formats and parsers, with validation and isolation as additional safeguards.

Treat files as untrusted input, review file-to-interpreter data flows, enforce policies against unsafe deserialization and dynamic evaluation, and run file processing with minimal privileges.

Find out what's already
exploitable in your codebase.