HyperSpy 2.6.0 Patch Fixes High-Severity Code Execution Flaw in Microscopy Data Files

2 min read
Source: CVEs | Zero Wire | Cloudflare Radar
HyperSpy 2.6.0 Patch Fixes High-Severity Code Execution Flaw in Microscopy Data Files
Photo: CVEs | Zero Wire | Cloudflare Radar
TL;DR

A high-severity vulnerability in the HyperSpy Python library, affecting versions 1.2.0 through 2.5.0, has been patched in version 2.6.0. The flaw allows attackers to execute arbitrary code by embedding malicious expressions in .hspy or .zspy files, which are evaluated using sympy.sympify() when users load or restore models. The fix replaces the unsafe evaluation method with a restricted parser, requiring users to upgrade both HyperSpy and RosettaSciIO to mitigate the risk.

Key points

  • CVE-2026-138117 affects HyperSpy versions 1.2.0 to 2.5.0, with a CVSS score of 8.5 (High) under CVSS 4.0 and 7.8 under CVSS 3.1.
  • The vulnerability stems from improper neutralization of directives in dynamically evaluated code, specifically using sympy.sympify() on unsanitized input from files.
  • Attackers can exploit this by crafting malicious .hspy or .zspy files that execute code when victims call hs.load() or restore models, requiring user interaction but no prior privileges.
  • The fix in version 2.6.0, released on November 27, 2026, replaces the unsafe sympify() evaluation with a restricted, bounded expression parser.
  • Users must upgrade both HyperSpy to 2.6.0 and RosettaSciIO to version 0.16.0 or higher to fully remediate the vulnerability, as upgrading HyperSpy alone does not fix RosettaSciIO-owned readers.

Background

This vulnerability follows a recent trend of high-severity code execution flaws in scientific Python libraries, including similar issues in DeepSpeed and PyTorch involving malicious checkpoint files. HyperSpy, an open-source library for microscopy data analysis, is widely used in research environments, making this flaw particularly risky for shared workstations. The vulnerability was reported by researchers Nils Jordan and Dilanka Kaushal Hewage in November 2026, with the coordinated fix released shortly after.

Why it matters

The vulnerability poses a significant risk to researchers and developers using HyperSpy for data analysis, as it allows arbitrary code execution on shared workstations. The flaw's high severity and the requirement for user interaction highlight the importance of updating scientific software to mitigate risks from malicious files. The coordinated fix ensures that both HyperSpy and RosettaSciIO are updated, addressing potential gaps in security.

What to watch

Users of HyperSpy versions 1.2.0 to 2.5.0 should immediately upgrade to version 2.6.0 and ensure RosettaSciIO is updated to version 0.16.0 or higher. Organizations should review their use of .hspy and .zspy files and consider implementing additional security measures to prevent the execution of untrusted code. Monitoring for any further related advisories, such as those tracking cloudpickle deserialization issues, is recommended.

Share this article

Want the full story? Read the original reporting

Read on CVEs | Zero Wire | Cloudflare Radar