# CVE-2026-138118

Insecure deserialization in HyperSpy allows code execution from crafted .hspy/.zspy files

- Page: https://www.vulneraibility.com/cve/CVE-2026-138118
- CVSS: 8.5
- Known exploited: not in CISA KEV as of our last sync
- EPSS: 0.22% (percentile 7.6)
- Weakness: CWE-502
- Also known as: GHSA-j975-x368-3hrr
- EUVD: EUVD-2026-137533 (https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-137533)
- Published: 2026-11-28

## Affected versions

- HyperSpy: affected >= 1.4.0 and < 2.6.0

A version outside these ranges is not a statement that it is unaffected.

## Impact

Arbitrary Python code execution when a victim loads a crafted .hspy/.zspy model file; attackers can run commands as the user opening the file.

## Action

Immediate action required

## Recommendation

Update to HyperSpy 2.6.0 and do not open untrusted .hspy/.zspy files.

## References

- [advisory] https://github.com/hyperspy/hyperspy/security/advisories/GHSA-j975-x368-3hrr
- [patch] https://github.com/hyperspy/hyperspy/commit/6382ae0ff5b0000a7aad5dc2f4b997b1d8dccb09
- [patch] https://github.com/hyperspy/hyperspy/commit/28fdf2d0320c76c5d57a57e323ac510b2005e13d
- [other] https://github.com/hyperspy/hyperspy/releases/tag/v2.6.0
- [other] https://github.com/hyperspy/hyperspy/issues/3699
- [other] https://github.com/hyperspy/hyperspy/blob/v2.5.0/hyperspy/model.py#L106-L146
- [other] https://github.com/hyperspy/hyperspy/blob/v2.5.0/hyperspy/model.py#L645-L661
- [other] https://github.com/hyperspy/hyperspy/blob/v2.5.0/hyperspy/misc/export_dictionary.py#L187-L207
- [advisory] https://www.vulncheck.com/advisories/hyperspy-1.4.0-before-2.6.0-insecure-deserialization-rce-via-stored-model-restoration
- [EUVD (ENISA)] https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-137533

---
Summary, impact and action are written by the vulneraibility.com AI analysis pipeline from the CVE record, NVD, CISA and FIRST data; verify against the references.
