Skip to main content
Vulnerability Database/CVE-2026-112079

CVE-2026-112079: HanLP Deserialization RCE Vulnerability

CVE-2026-112079 is a deserialization vulnerability in HanLP library that enables remote code execution through the load_word2vec_as_vocab_tensor function. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-112079 Overview

CVE-2026-112079 is an insecure deserialization vulnerability in hankcs HanLP, a widely used natural language processing (NLP) library. The flaw affects versions up to and including 2.1.0-beta.64. It resides in the load_word2vec_as_vocab_tensor function within hanlp/utils/torch_util.py. Attackers can manipulate the vectors.vocab argument to trigger unsafe deserialization of pickle data. A public proof-of-concept has been disclosed. The maintainers were notified via issue report but have not responded at the time of publication. The vulnerability is categorized under [CWE-20] (Improper Input Validation).

Critical Impact

Processing an attacker-supplied vocabulary file through HanLP's load_word2vec_as_vocab_tensor can lead to arbitrary code execution via Python pickle deserialization.

Affected Products

  • hankcs HanLP versions up to 2.1.0-beta.64
  • Component: hanlp/utils/torch_util.py
  • Function: load_word2vec_as_vocab_tensor

Discovery Timeline

  • 2026-10-19 - CVE-2026-112079 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-112079

Vulnerability Analysis

HanLP's load_word2vec_as_vocab_tensor function in hanlp/utils/torch_util.py loads vocabulary data without validating or restricting the deserialization process. The function accepts a file path or buffer corresponding to the vectors.vocab argument. When this input is backed by Python's pickle format, loading reconstructs objects using whatever classes and callables the serialized stream specifies. An attacker who can supply or substitute the vocabulary file can embed a malicious pickle payload that executes arbitrary Python code at load time. User interaction is required because a victim must open or process the attacker-crafted artifact within a HanLP workflow.

Root Cause

The root cause is improper input validation [CWE-20] during model and vocabulary loading. The function trusts the incoming vocabulary stream and relies on Python's pickle deserialization, which is unsafe for untrusted data. No signature validation, format whitelisting, or restricted unpickler is applied before the serialized objects are reconstructed.

Attack Vector

The attack is network-reachable because HanLP vocabulary and vector files are commonly shared through public repositories, model hubs, and dataset mirrors. An attacker publishes or substitutes a crafted vectors.vocab pickle file. A developer or automated pipeline that downloads the artifact and calls load_word2vec_as_vocab_tensor triggers deserialization. Arbitrary objects defined in the payload execute inside the Python process running HanLP, inheriting its privileges and access to local data and credentials. A public proof-of-concept vocabulary file is referenced in the HanLP PoC Vocabulary File attached to GitHub Issue #1968 for HanLP.

Stop Remote Code Execution Before It Runs

Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.

Stop Exploit Attempts

Detection Methods for CVE-2026-112079

Indicators of Compromise

  • Unexpected child processes spawned by Python interpreters running HanLP, such as shells, curl, wget, or outbound network tools.
  • Vocabulary or model files (.vocab, .pkl, .pickle) sourced from untrusted mirrors or recently modified in model caches.
  • Pickle opcodes referencing dangerous callables such as os.system, subprocess.Popen, builtins.eval, or builtins.exec within vocabulary files.

Detection Strategies

  • Scan filesystem locations used by HanLP (model caches, project directories) for pickle files and inspect them with a static pickle analyzer (for example, pickletools or fickling).
  • Instrument Python processes to log calls to pickle.load and pickle.loads originating from hanlp/utils/torch_util.py and alert on invocations against externally sourced files.
  • Monitor software supply chain feeds for malicious or typosquatted HanLP model packages distributed through third-party hubs.

Monitoring Recommendations

  • Alert on process trees where a Python runtime executing HanLP spawns command interpreters or performs outbound connections to unapproved destinations.
  • Capture and retain hashes of model and vocabulary files downloaded by data science pipelines to support retroactive investigation.
  • Correlate endpoint telemetry with network egress to detect post-exploitation beaconing from workstations running NLP workloads.

How to Mitigate CVE-2026-112079

Immediate Actions Required

  • Do not load vectors.vocab or related pickle files from untrusted or unauthenticated sources into HanLP workflows.
  • Audit existing HanLP model caches and remove vocabulary files whose provenance cannot be verified.
  • Isolate systems that process third-party NLP artifacts in sandboxed or ephemeral environments with no production credentials.

Patch Information

No vendor patch is available at the time of publication. The project was notified through GitHub Issue #1968 for HanLP but has not responded. Monitor the GitHub HanLP Repository and VulDB CVE-2026-112079 entry for updates and fixed releases.

Workarounds

  • Replace Python's default pickle.load usage with a restricted unpickler that whitelists only expected tensor and vocabulary classes.
  • Pin HanLP dependencies and vocabulary artifacts to internally reviewed, cryptographically verified versions distributed from a trusted artifact registry.
  • Run HanLP in least-privilege service accounts without access to secrets, source repositories, or production datastores.
  • Enforce egress filtering on hosts running NLP pipelines to limit the impact of code executed during model loading.
bash
# Example: verify a vocabulary artifact hash before loading in a pipeline
sha256sum ./models/vectors.vocab | awk '{print $1}' > current.sha256
diff current.sha256 approved.sha256 || { echo 'Untrusted vocab file - aborting'; exit 1; }

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.