---
id: "CVE-2026-112079"
kind: "vulnerability"
aliases: ["CVE-2026-112079"]
title: "HanLP: unsafe deserialization in word2vec vocab loader enables remote code"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["hanlp", "ml-pipelines", "package", "python"]
not_affected_if: ["no-word2vec-loading", "trusted-models-only"]
published_at: "2026-10-19T05:17:04+00:00"
first_seen_at: "2026-10-23T21:57:17+00:00"
updated_at: "2026-10-25T03:23:22+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-112079", "first_seen_at": "2026-10-23T21:57:17+00:00"}]
---

# HanLP: unsafe deserialization in word2vec vocab loader enables remote code

HanLP, a Python natural language processing library, has an unsafe deserialization flaw in its load_word2vec_as_vocab_tensor function when handling the vectors.vocab argument. A remote attacker can supply a crafted model file so that loading it runs attacker-chosen code on the machine that loads it.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- `pip show hanlp` to read the installed version
- Search your code and models for calls to `load_word2vec_as_vocab_tensor` or word2vec models loaded from untrusted sources

## Fix

- Upgrade past `2.1.0-beta.64`; no fixed version is named in the sources
- Load word2vec or other model files only from trusted sources until a fix is released

## Timeline

- 2026-10-23T21:57:17+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-112079

## From the sources

A vulnerability has been found in hankcs HanLP up to 2.1.0-beta.64. The affected element is the function load_word2vec_as_vocab_tensor of the file hanlp/utils/torch_util.py. The manipulation of the argument vectors.vocab leads to deserialization. The attack is possible to be carried out remotely. The exploit has been disclosed to the public and may be used. The project was informed of the problem early through an issue report but has not responded yet.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
