CVE-2026-138118: HyperSpy 1.4.0 before 2.6.0 Insecure Deserialization RCE via Stored Model Restoration
HyperSpy from 1.4.0 before 2.6.0 contains an insecure deserialization vulnerability that allows attackers to execute arbitrary Python code by supplying crafted stored-model data in .hspy or .zspy files. Attackers can embed a malicious pickle payload in a component's classdump or a 'fn'-flagged whitelist entry, which cloudpickle.loads() (dill in 1.x) runs when the victim restores the model.
Affected Software
Event History
Frequently Asked Questions
Who can exploit this issue, and what must the victim do?
An attacker must provide a crafted .hspy or .zspy file containing malicious stored-model data. Exploitation occurs when a victim restores the model; the attacker does not need prior privileges in the victim's HyperSpy environment.
Which installations are known to be affected?
HyperSpy versions from 1.4.0 up to, but not including, 2.6.0 are affected. The provided information does not establish whether versions earlier than 1.4.0 are affected.
What can be done before updating?
Do not restore models from untrusted or unverifiable .hspy or .zspy files. Treat stored-model data as potentially executable because restoration can deserialize malicious payloads through component _class_dump data or fn-flagged _whitelist entries.
How can I determine whether a file may trigger the issue?
A potentially malicious file contains crafted serialized data in a component's _class_dump field or in a _whitelist entry marked with the fn flag. The payload executes during model restoration, rather than merely from the file being present.