Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious .hspy/.zspy stored model
-
DeliveryEmbed pickle payload in _class_dump or 'fn' whitelist
-
ExploitDeliver file to victim researcher
-
ExecutionVictim calls models.restore() or builds model from dict
-
Persistcloudpickle.loads() runs payload
-
ImpactArbitrary Python executes as user
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires that the victim restore or directly construct a HyperSpy model from attacker-controlled content: the sink is reached through models.restore()/models.pop() (or create_model from an untrusted dictionary) on a stored model whose component carries a crafted _class_dump or an 'fn'-flagged _whitelist entry; cloudpickle.loads() (dill in 1.x) then runs the embedded pickle. The advisory explicitly notes that an ordinary hs.load() does not by itself deserialize the stored model, and lazy=True is NOT a mitigation. Limiting factors: the attacker has no network vector (AV:L - the malicious model file must be delivered to and opened by the victim), user interaction is required (UI:P/UI:R), code runs only with the victim user's privileges, and only affected versions are vulnerable (2.0.0-2.5.0 and 1.4.0-1.7.6). On the fixed 2.6.0 branch restoration of pickled custom classes/functions is denied by default with UnsafeLegacyContent unless the operator opts in with trusted=True, which deliberately re-enables code execution and must never be used with untrusted content. |
| Impact | Signals are mostly consistent and point to a real but conditional threat rather than a mass-exploitation emergency. The CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H) and the vendor's CVSS 3.1 score of 7.8 both describe a local, user-interaction-dependent code-execution flaw with high impact to confidentiality, integrity and availability - not a remotely reachable, self-propagating bug. CWE-502 insecure deserialization via cloudpickle.loads() (dill in 1.x) is a well-understood, reliably exploitable class once a victim is induced to restore a crafted model, and a benign proof-of-concept exercising the real reconstruct_object() boundary is published in the GHSA advisory, so exploitability is demonstrated. However, this is not CISA KEV-listed and no EPSS score was provided, so there is no evidence of active or widespread exploitation; the vuln.today priority is 'this_week', consistent with a patch-promptly posture rather than emergency. The decisive limiter is the attack vector: exploitation requires delivering a malicious .hspy/.zspy stored model AND the victim explicitly calling models.restore()/models.pop() or constructing a model from an untrusted dictionary - note the advisory explicitly states hs.load() alone does not trigger it. Net: a genuine high-severity issue worth prompt patching for HyperSpy users, but real-world risk is bounded by its local/social-engineering delivery and the narrow deployment footprint of a scientific Python library. |
| Exploit ScenarioDerived | An attacker distributes a malicious HyperSpy stored-model file (.hspy/.zspy) - for example shared as research data or an analysis template - in which a component's _class_dump or an 'fn'-flagged _whitelist entry contains a crafted pickle payload. When a researcher restores that model with s.models.restore(name) (or builds a model from the untrusted dictionary), cloudpickle.loads() executes the embedded Python with the victim's privileges. A benign, working proof-of-concept invoking the affected reconstruct_object() boundary is published in the vendor advisory, so the trigger path is demonstrated; exploitation is local and requires the victim to perform the restore action (UI:P/UI:R). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 28, 2026
Restoring a crafted HyperSpy stored model (.hspy or .zspy) can execute arbitrary Python code with the victim's privileges, because component _class_dump data and fn-flagged _whitelist entries are passed to cloudpickle.loads() (dill on the 1.x line) during model reconstruction. Affected are HyperSpy 2.0.0 through 2.5.0 and the source-confirmed 1.x range 1.4.0 through 1.7.6; the trigger is reached through models.restore()/models.pop() or create_model() from an untrusted dictionary, not by an ordinary hs.load() alone, and the vector (AV:L, UI:P/UI:R, PR:N) confirms a local, user-interaction-dependent path where the malicious model file must be delivered to and opened by the victim. A public proof-of-concept that exercises the real reconstruct_object() boundary with a benign marker file is documented in the vendor advisory; no confirmed active exploitation, CISA KEV listing, or EPSS score was provided in the source data, and the vendor fix in 2.6.0 denies pickled legacy content by default with UnsafeLegacyContent.
RemediationAI
Vendor-released patch: HyperSpy 2.6.0 (https://github.com/hyperspy/hyperspy/releases/tag/v2.6.0), which denies pickled custom classes and functions by default with UnsafeLegacyContent; the fixes land in commits 6382ae0ff5b0000a7aad5dc2f4b997b1d8dccb09 and 28fdf2d0320c76c5d57a57e323ac510b2005e13d, both referenced from the advisory GHSA-j975-x368-3hrr. Users on the EOL 1.x line (1.4.0 through 1.7.6) must upgrade to 2.6.0 because no backport is provided. Until upgrading, the vendor's stated mitigation is to not restore or directly construct models from untrusted files or dictionaries - models.restore(), models.pop() and create_model(dictionary=...) on attacker-controlled content are the risky operations - and the advisory explicitly warns that lazy=True is not a mitigation. After upgrading, the keyword-only trusted=True option deliberately re-enables Python deserialization and is not a sandbox; it must never be applied to content of unknown provenance or integrity. For custom components, register them through HyperSpy's extension mechanism or recreate them as Expression components so they restore without pickled class content.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The root cause class is CWE-502, Deserialization of Untrusted Data. HyperSpy stores models as dictionaries containing Python object state; for components that are not registered with HyperSpy's extension registry, the serialized class blob in comp_dictionary["_class_dump"] is rebuilt through cloudpickle.loads() in hyperspy/model.py (versions 2.x) or through the corresponding dill sink on the 1.x line. A second file-controlled sink exists in hyperspy/misc/export_dictionary.py, where reconstruct_object() will unpickle a stored value marked with an "fn" flag via an fn-flagged _whitelist entry. Both inputs are bytes controlled by the stored model, and cloudpickle uses Python's pickle protocol, which the Python documentation and the cloudpickle security notice explicitly warn must never be applied to untrusted data. The fix introduces an UnsafeLegacyContent exception (a subclass of ValueError) and a _trust_scope context manager in hyperspy/misc/export_dictionary.py, plus a keyword-only trusted=False parameter on Model1D/Model2D create_model() and on ModelManager.restore()/pop(); registered built-in components restore through the extension registry without executing legacy class dumps. The advisory also notes that the external report's mention of SAMFire's internal cloudpickle calls was not established as a file-controlled path and is not claimed as remediated, and that the separate RosettaSciIO ZSPY pickle codec issue is tracked independently in GHSA-98rv-6jxj-5fxr.
Know when Hyperspy gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
The malicious model file is delivered and opened locally by the victim, so AV:L and UI:R; no prior privileges are needed (PR:N) and arbitrary code yields full C/I/A impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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 _class_dump or a 'fn'-flagged _whitelist entry, which cloudpickle.loads() (dill in 1.x) runs when the victim restores the model.
Articles & Coverage 1
Technical POC Analysis
CWE-502 (Deserialization of Untrusted Data), with two distinct sinks in HyperSpy itself: hyperspy/model.py, reconstructcomponent().
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
CVE-2026-138118 is a high-severity vulnerability in HyperSpy versions 2.0.0 through 2.5.0 and 1.4.0 through 1.7.6 that allows arbitrary code execution when a user opens a maliciously crafted model file, potentially leading to full system compromise. Leadership should prioritize remediation because researchers and engineers using HyperSpy in trusted workflows are at risk, and successful exploitation could result in data theft, intellectual property loss, and operational disruption.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.
EUVD-2026-137533
GHSA-6rm7-x9w5-p3h8
NVD
CVE.org
EPSS
Exploit-DB