Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessDeliver crafted .hspy/.zspy file or stored model
-
ExploitVictim calls hs.load() or restores model
-
ExecutionFile-derived expression reaches sympy.sympify()/eval()
-
ImpactArbitrary Python executes with user privileges
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Eval input sanitization
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the victim to open an untrusted HyperSpy file (.hspy/.zspy) via hs.load(), or to restore or fit a stored model built from an untrusted file or dictionary. The specific triggering sinks are: a functional-axis 'expression' attribute evaluated during hs.load() (present from 1.7.0 and in 2.x), and stored Expression.expression and twin_function_expr strings evaluated during model restoration (source-confirmed from 1.2.0). Limiting factors defenders can rely on: the attack is local (AV:L) with no network-exposed service, and it requires user interaction (UI:P) - the victim must actively load or restore the crafted artifact. Notably, lazy=True (lazy loading) is NOT a mitigation because axis construction and metadata parsing still occur. No authentication is required of the attacker (PR:N), but the file must come from a source the victim trusts enough to open. The only complete fix is upgrading to 2.6.0 (with coordinated RosettaSciIO fixed versions, since upgrading HyperSpy alone does not remediate RosettaSciIO-owned readers); until then the vendor's workaround is to not open or restore models from untrusted files or dictionaries. |
| Impact | The input CVSS 4.0 vector (8.5, AV:L/AC:L/PR:N/UI:P) and the GHSA-stated CVSS 3.1 (7.8, local, user-interaction-required) agree that this is a file-triggered, not network-triggered, code-execution flaw: there is no remote listening service to attack, so exploitation depends on a victim opening or restoring a crafted file. No EPSS score and no CISA KEV entry are present in the input, and the flaw is not in CISA KEV, so there is no evidence of active exploitation. However, a working benign proof-of-concept reproduction (writing a marker file) is published directly in the GHSA advisory, demonstrating the trigger is real and easy to weaponize. The vuln.today priority is 'this_week' and a vendor patch (2.6.0) exists. Net: this is a genuine high-impact issue (full C/I/A compromise with user privileges) but its real-world risk is gated by the local attack vector and required user interaction, making it a targeted social-engineering / untrusted-data-exchange risk rather than a mass-exploitable remote threat. The local vector plus required user interaction, combined with HyperSpy's niche scientific-computing user base, argues for prompt but not emergency remediation, consistent with the 'this_week' label. |
| Exploit ScenarioDerived | An attacker distributes a crafted .hspy or .zspy file (or a stored model dictionary) through normal scientific data-exchange channels; the embedded malicious axis, Expression-component, or twin-function expression string reaches sympy.sympify(), which parses it with Python eval(). When the victim calls hs.load() or restores/fits the model, arbitrary Python executes with the victim's privileges. A benign public proof-of-concept reproduction is published in the GHSA advisory, and because the attack vector is local with required user interaction, it depends on convincing the victim to open an untrusted file. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 28, 2026
Arbitrary Python code execution in HyperSpy affects both the 1.x series (1.2.0 through 1.7.6) and 2.x (2.0.0 through 2.5.0): file-supplied mathematical expressions are passed to sympy.sympify(), which evaluates strings with real Python builtins, so a crafted .hspy or .zspy file can run attacker code in the analyst's session when a victim calls hs.load() or restores a stored model. Exploitation is local and requires the victim to actively open or restore the crafted artifact (CVSS 3.1: 7.8, AV:L/UI:R; no attacker authentication, PR:N), and lazy=True offers no protection because axis construction and metadata parsing still occur during loading. There is no KEV listing and no confirmed active exploitation, but a public PoC reference exists in the vendor advisory and issue #3699, and the fix is HyperSpy 2.6.0 with coordinated RosettaSciIO fixed versions.
RemediationAI
Vendor-released patch: HyperSpy 2.6.0, which fixes both the 1.x range (up to 1.7.6) and the 2.x range (up to 2.5.0); there is no backport for the end-of-life 1.x series. Upgrading HyperSpy alone is insufficient for readers owned by RosettaSciIO, so install the coordinated RosettaSciIO fixed version (>=0.16.0 per the advisory) alongside HyperSpy 2.6.0, which also requires Python >=3.11 and SymPy >=1.14 (release notes: https://github.com/hyperspy/hyperspy/releases/tag/v2.6.0; commits fe484c936b9a1d425813e145298f9eeb1d83abf6 and 973c9f9ce5937a022afe718f4f63c410eb96539e). Be aware of a behavioral side effect: the new restricted parser only accepts arithmetic, comparison and boolean operators and a subset of SymPy functions, so existing saved models that use unsupported function names raise an error and must be rewritten. Until upgrading, the vendor's only stated workaround is to not open or restore models from untrusted .hspy or .zspy files and not to construct models from untrusted dictionaries; lazy=True is explicitly not a mitigation, and if untrusted files must be processed they should be read in a separate, terminable process or environment holding no credentials, accepting that this does not sandbox CPU or memory consumption.
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
HyperSpy persists mathematical models as expression strings and, in affected versions, feeds those strings straight into sympy.sympify(). SymPy's string parser is built on Python eval() with real builtins and the SymPy documentation explicitly warns against using it on unsanitized input, which places this squarely in CWE-95 (improper neutralization of directives in dynamically evaluated code). The vendor advisory groups the issue under both CWE-94 and CWE-95 and describes several distinct sinks into one evaluation weakness: functional-axis 'expression' attributes evaluated during hs.load() (applicable from 1.7.0), stored Expression.expression strings evaluated when a model is restored, and twin_function_expr / inverse-twin expressions evaluated on restoration, plus additional expression paths in rotation coordinates, nested signals and later fitting. Source locations in 2.5.0 are hyperspy/axes.py, hyperspy/_components/expression.py and hyperspy/component.py. The advisory is explicit that these are expression-evaluation triggers, not cloudpickle deserialization or class-pollution issues, which are tracked in separate advisories. The 2.6.0 fix replaces sympify() with a restricted, bounded parser (hyperspy.misc._sympy_parse with parse_expression, lambdify_ordered, validate_identifier and validate_modules), validates identifiers, modules and rotation-center coordinates, bumps the SymPy floor to >=1.14, and requires coordinated RosettaSciIO >=0.16.0 because some readers live in that package. The vendor also states the new parser is not a general CPU or memory sandbox, so untrusted files remain a resource-exhaustion risk.
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
Code execution is triggered by opening a crafted local file, so AV:L and UI:R; no attacker privileges are needed (PR:N) and execution yields full host C/I/A impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
HyperSpy from 1.2.0 before 2.6.0 contains a code execution vulnerability that allows attackers to run Python code by embedding malicious expression strings evaluated with sympy.sympify(). Attackers can craft .hspy or .zspy files with malicious axis, Expression component, or twin function expressions that execute when victims call hs.load() or restore models.
Articles & Coverage 1
Technical POC Analysis
CWE-95 (the advisory also tags CWE-94): HyperSpy stores mathematical expressions as strings and passes file-controlled strings to sympy.sympify(), whose string parsing uses Python eval() with real bu…
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-138117 is a high-severity vulnerability in HyperSpy, a data analysis tool used by our research teams, that allows malicious code to execute when analysts open specially crafted data files. An attacker could exploit this to compromise sensitive data or systems, but requires a victim to open a malicious file, likely through social engineering. Leadership should prioritize patching because the tool is integral to scientific workflows and a breach could disrupt research operations and expose confidential information.
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
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
EUVD-2026-137534
GHSA-9qmf-m9r2-5w65
NVD
CVE.org
EPSS
Exploit-DB