CVE-2026-138117
7.8HighPublished Nov 28, 2026 · NVD status: Received · AI triage by gemini-3.1-flash-lite
High
0CVSS v3.110
- Attack vector
- Local
- Complexity
- Low
- Privileges
- None
- User action
- Required
- Impact
- Full C/I/A compromise
- Weakness
- CWE-95
What an attacker gets
Attackers can execute arbitrary Python code on your system. This happens when a user opens a malicious .hspy or .zspy file using hs.load().
Root cause
The library uses sympy.sympify() to evaluate expressions from file inputs without proper sanitization.
Affected versions
HyperSpy 1.2.0 through 2.5.x
CVSS v3.1 · CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Fix & remediation
Upgrade to HyperSpy 2.6.0 or later. Do not open untrusted .hspy or .zspy files until the package is updated.
$ pip install --upgrade hyperspyAI-suggested. Run it in staging first and check it against the vendor advisory. Why?
NVD 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.
References
- 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/axes.py#L1031-L1071
- https://github.com/hyperspy/hyperspy/blob/v2.5.0/hyperspy/component.py#L205-L217
- https://github.com/hyperspy/hyperspy/commit/973c9f9ce5937a022afe718f4f63c410eb96539e
- https://github.com/hyperspy/hyperspy/commit/fe484c936b9a1d425813e145298f9eeb1d83abf6
- https://github.com/hyperspy/hyperspy/issues/3699
- https://github.com/hyperspy/hyperspy/releases/tag/v2.6.0
- https://github.com/hyperspy/hyperspy/security/advisories/GHSA-632c-gw75-99r3
- https://www.vulncheck.com/advisories/hyperspy-before-2.6.0-code-execution-via-sympy-sympify-in-hspy-zspy-files
Related Critical / High CVEs
More fully triaged vulnerabilities you may want to check next.
- CVE-2026-1381187.8HighAttackers can execute arbitrary Python code by providing a malicious .hspy or .zspy file. A user must open or restore a crafted model file for the exploit to trigger.
- CVE-2026-1381627.0HighAttackers can execute arbitrary code or crash the application by providing a crafted backup file. This requires a user to perform a restore or addnew operation on an attached Alcatel phone.
- CVE-2026-1381617.8HighAttackers can achieve code execution by providing a crafted backup file with an overlong MD5 value. This requires a user to process a malicious file using convertbackup or restore.
- CVE-2026-1381607.8HighAttackers can execute arbitrary code or crash the application by providing a malicious backup file. This requires a user to trigger a restore or backup process with a crafted file.
- CVE-2026-1381597.5HighRemote attackers can execute arbitrary code or crash the application by sending a response body larger than 2 GB. This requires a user to browse to an attacker-controlled HTTP, FTP, or gopher server.
- CVE-2026-1381548.6HighAttackers can execute arbitrary code on your machine as the current user. This requires a user to subscribe to a malicious Steam Workshop mod.