CVE-2026-138117 HyperSpy before 2.6.0 Code Execution via sympy.sympify() in HSPY/ZSPY Files
HighCVSS 8.5
EPSS 0.25%
- Published
- Updated
- Exploit status
- No public exploit known
Description
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.
Upgrade path
1 package: 1 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| pypi hyperspy | >= 1.2.0, < 2.6.0 | 2.6.0 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| pypi hyperspy | >= 1.2.0, < 2.6.0 | 2.6.0 |
References
- GitHub Security Advisory (GHSA-632c-gw75-99r3) vendor-advisory
- Merge of PR #3703 (bounded expression parser) patch
- fix(security): parse file-derived expressions with the bounded parser patch
- HyperSpy v2.6.0 Release Notes release-notes
- GitHub issue #3699 issue-tracking
- FunctionalDataAxis.__init__ in axes.py (v2.5.0) technical-description
- _parse_substitutions in expression.py (v2.5.0) technical-description
- twin_function_expr setter in component.py (v2.5.0) technical-description
- VulnCheck Advisory: HyperSpy before 2.6.0 Code Execution via sympy.sympify() in HSPY/ZSPY Files third-party-advisory
- ENISA EUVD EUVD-2026-137534 third-party-advisory
- nvd.nist.gov