CVE-2026-138117

HyperSpy before 2.6.0 Code Execution via sympy.sympify() in HSPY/ZSPY Files

Published Nov 28, 2026 CVSS 4.0 · 8.5 High EPSS n/a KEV · Not listed
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.

Analysis

AI-generated

Technical impact

HyperSpy versions from 1.2.0 up to, but not including, 2.6.0 allow an attacker to insert malicious Python code into .hspy or .zspy files. The vulnerability is caused by untrusted expression strings being passed to sympy.sympify, which evaluates the string as executable Python code during file loading or model restoration. An attacker can embed arbitrary code in the axis, Expression component, or twin function expressions, leading to full code execution in the context of the user running hyperSpy.

Affected Systems

The affected product is HyperSpy. Any installation using HyperSpy 1.2.0 through 2.5.x may be vulnerable. The vulnerability is documented as affecting all releases before 2.6.0. No specific minor or patch versions were listed in the CNA information.

Risk and Exploitability

The CVSS score is 8.5, indicating a high severity of code execution. No EPSS score is available and the vulnerability is not listed in CISA's KEV catalog. The attack vector is inferred to be local file ingestion, likely requiring the victim to open a crafted .hspy or .zspy file using hs.load() or a related restore operation. Because the code is executed within the Python interpreter, the impact can reach system privileges depending on the runtime environment. The vulnerability is not known to be actively exploited yet but poses significant risk if used in a local or network context where untrusted files are processed.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade HyperSpy to 2.6.0 or later to apply the security fix.
  • Avoid loading .hspy or .zspy files from untrusted sources; treat all external files as potentially malicious.
  • When processing external files, first validate or sanitize the content and ensure that expression evaluation is disabled or constrained to a safe subset.
  • Consider running hyperSpy in a restricted or sandboxed environment to limit the impact of any accidental code execution.

Generated by OpenCVE AI on November 28, 2026 at 02:20 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
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.
Title HyperSpy before 2.6.0 Code Execution via sympy.sympify() in HSPY/ZSPY Files
Weaknesses CWE-95
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.5, 'vector': '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'}

Subscriptions

No data.

Weaknesses
  • CWE-95

    Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Nov 28, 2026, 1:43 AM
Reserved
Nov 27, 2026, 11:50 PM
Status
Received
Published
Nov 28, 2026, 2:17 AM
Modified
Nov 28, 2026, 2:17 AM