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 eva…
Impact
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.
An attacker can exploit this with local access to the system, without logging in, but a user has to be involved, for example by viewing content. If it succeeds: high risk of data being read, high risk of data or systems being changed, high risk of outages.
Affected products (HyperSpy)
| Product | Affected versions |
|---|---|
| HyperSpy | from 1.2.0 before 2.6.0 |
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://github.com/hyperspy/hyperspy/security/advisories/GHSA-632c-gw75-99r3
- https://github.com/hyperspy/hyperspy/commit/fe484c936b9a1d425813e145298f9eeb1d83abf6
- https://github.com/hyperspy/hyperspy/commit/973c9f9ce5937a022afe718f4f63c410eb96539e
- https://github.com/hyperspy/hyperspy/releases/tag/v2.6.0
- https://github.com/hyperspy/hyperspy/issues/3699
- https://github.com/hyperspy/hyperspy/blob/v2.5.0/hyperspy/axes.py#L1031-L1071
- https://github.com/hyperspy/hyperspy/blob/v2.5.0/hyperspy/_components/expression.py#L58-L66
- https://github.com/hyperspy/hyperspy/blob/v2.5.0/hyperspy/component.py#L205-L217
- https://www.vulncheck.com/advisories/hyperspy-before-2.6.0-code-execution-via-sympy-sympify-in-hspy-zspy-files
- https://github.com/advisories/GHSA-9qmf-m9r2-5w65
- https://nvd.nist.gov/vuln/detail/CVE-2026-138117