CVE-2026-138117 — HyperSpy
One of 2 HyperSpy vulnerabilities published together by NVD: our article covers all of them.
PythonVulnerabilitiesSummary
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.
Severity breakdown
High · 8.5
An attacker without an account can exploit this with local access if a user views or visits something.
- Attack from
- local access (a logged-in user, or a malicious file opened on the device)
- Attack complexity
- low (no special conditions)
- Special conditions
- none
- Login needed
- no
- User action needed
- yes, a user must view or visit something
- Impact
- high on confidentiality, integrity and availability
- Impact on other systems
- none
Weakness
- CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| HyperSpy | ≥ 1.2.0, < 2.6.0 | 2.6.0 |
References by type
Vendor advisories
Patches and fixed releases
- github.com/hyperspy/hyperspy/commit/973c9f9ce5937a022afe718f4f63c410eb9…
- github.com/hyperspy/hyperspy/commit/fe484c936b9a1d425813e145298f9eeb1d8…
- github.com/hyperspy/hyperspy/releases/tag/v2.6.0
Other references
- github.com/hyperspy/hyperspy/blob/v2.5.0/hyperspy/_components/expressio…
- github.com/hyperspy/hyperspy/blob/v2.5.0/hyperspy/axes.py
- github.com/hyperspy/hyperspy/blob/v2.5.0/hyperspy/component.py
- github.com/hyperspy/hyperspy/issues/3699
- vulncheck.com/advisories/hyperspy-before-2.6.0-code-execution-via-sympy…
Affected
- HyperSpy
What to do
- Check whether you run an affected product or version and apply the vendor's update or mitigation.
- Follow the vendor advisory and the references below for fixed versions and workarounds.
Frequently asked questions
What is CVE-2026-138117?
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. Weakness type: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') (CWE-95).
How severe is CVE-2026-138117?
CVE-2026-138117 has a CVSS 4.0 base score of 8.5 (high), from the CNA (vulncheck.com). An attacker without an account can exploit this with local access if a user views or visits something.
Is CVE-2026-138117 being exploited?
Not as far as is known: CVE-2026-138117 is not in CISA's Known Exploited Vulnerabilities catalog as of November 28, 2026.
Which versions are affected by CVE-2026-138117?
HyperSpy ≥ 1.2.0, < 2.6.0 (fixed in 2.6.0).
How do I fix CVE-2026-138117?
Update to a fixed release: HyperSpy 2.6.0.