Skip to main content

HyperSpy EUVDEUVD-2026-137534

| CVE-2026-138117 HIGH
Eval Injection (CWE-95)
2026-11-28 VulnCheck GHSA-9qmf-m9r2-5w65
8.5
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Deliver crafted .hspy/.zspy file or stored model
  2. Exploit
    Victim calls hs.load() or restores model
  3. Execution
    File-derived expression reaches sympy.sympify()/eval()
  4. Impact
    Arbitrary 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

HyperSpy 1.2.0 <2.6.0

Affected Packages

euvd hyperspy fix: 2.6.0

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

Vendor (VulnCheck) PRIMARY 8.5 HIGH
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
vuln.today AI 7.8 HIGH

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.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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.

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

Why It Matters

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.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.2%
Top 90% exploitable
Prevalence
Low
niche scientific Python library for microscopy/spectroscopy data analysis
Social Media
2
Sightings
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

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.

Related Vulnerabilities in HyperSpy Code Execution Vulnerabilities

View all 2

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy