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

CVE-2026-112081: HanLP Deserialization RCE Vulnerability

CVE-2026-112081 is a deserialization remote code execution flaw in hankcs HanLP up to version 2.1.0-beta.64 that enables attackers to execute arbitrary code. This post explains its impact, affected versions, and mitigation steps.

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-112081 Overview

CVE-2026-112081 is an insecure deserialization vulnerability in the hankcs/HanLP natural language processing library, affecting versions up to 2.1.0-beta.64. The flaw resides in the hanlp.load function within plugins/hanlp_common/hanlp_common/reflection.py, part of the Model Config Loading component. Attacker-controlled input passed through the classpath argument triggers unsafe deserialization [CWE-20]. The exploit has been publicly disclosed, and the project maintainers have not yet responded to the issue report.

Critical Impact

Attackers who can influence the classpath argument processed by hanlp.load can trigger deserialization of arbitrary classes, enabling code execution paths within the Python runtime hosting HanLP.

Affected Products

  • hankcs HanLP versions up to and including 2.1.0-beta.64
  • Component: Model Config Loading (plugins/hanlp_common/hanlp_common/reflection.py)
  • Function: hanlp.load

Discovery Timeline

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

Technical Details for CVE-2026-112081

Vulnerability Analysis

HanLP is a widely used multilingual natural language processing toolkit. The hanlp.load entry point reads a model configuration and resolves Python classes referenced by the classpath field using reflection. The reflection logic in plugins/hanlp_common/hanlp_common/reflection.py instantiates the referenced class without validating that it belongs to a trusted allowlist. An attacker who controls the model configuration can direct HanLP to load and instantiate arbitrary classes, which maps to an insecure deserialization condition.

The primary impact is on applications that call hanlp.load with configuration data sourced from remote hosts, user uploads, or shared model repositories. A tampered configuration can redirect class resolution to attacker-controlled gadgets available in the Python environment.

Root Cause

The root cause is improper input validation [CWE-20] in the reflection-based model loader. The classpath argument is treated as trusted metadata and dereferenced directly, with no restriction on which modules or classes may be instantiated. Any serialized model config consumed by hanlp.load becomes an execution directive rather than passive data.

Attack Vector

The attack is network-reachable and requires user interaction, typically loading a model or configuration supplied by an untrusted source. A proof-of-concept archive has been published alongside the GitHub issue report. Exploitation steps are described in the GitHub Issue #1969 and the GitHub PoC File. See the VulDB CVE-2026-112081 record for additional context.

No verified exploit code is reproduced here. Readers should consult the linked advisory and PoC archive for technical reproduction details.

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-112081

Indicators of Compromise

  • Unexpected child processes spawned by Python processes that import hanlp or hanlp_common.
  • Model configuration files containing a classpath value pointing to modules outside the hanlp package namespace.
  • Outbound network connections initiated by HanLP worker processes shortly after a hanlp.load call.

Detection Strategies

  • Inspect model configuration files consumed by hanlp.load and flag any classpath value that references non-HanLP modules such as os, subprocess, pickle, or arbitrary third-party packages.
  • Monitor Python runtime telemetry for reflection activity that instantiates classes immediately before process execution, file writes, or socket creation.
  • Correlate HanLP library imports with downloads of model archives from untrusted mirrors or user-uploaded storage buckets.

Monitoring Recommendations

  • Enable process-tree and command-line auditing on hosts running HanLP in production or ML pipelines.
  • Alert on python processes writing to directories outside the model cache, or executing shell interpreters following hanlp.load.
  • Track EPSS exposure for CVE-2026-112081 and re-evaluate when the project ships a patched release.

How to Mitigate CVE-2026-112081

Immediate Actions Required

  • Treat all HanLP model configurations as untrusted input until a fixed release is published. Only load models from verified first-party sources.
  • Audit internal services that call hanlp.load and restrict configuration sources to a signed, internally hosted mirror.
  • Isolate HanLP workloads in sandboxed containers with no outbound internet access and minimal filesystem privileges.
  • Review ingest pipelines for any user-uploaded .json, .yaml, or archive files consumed by HanLP.

Patch Information

As of the NVD publication date, the HanLP maintainers have not acknowledged the issue reported at GitHub Issue #1969, and no patched release is available. Track the HanLP repository for an upcoming fix beyond version 2.1.0-beta.64.

Workarounds

  • Wrap hanlp.load with a pre-flight validator that parses the configuration and rejects any classpath value not matching an allowlist of hanlp.* modules.
  • Run HanLP under a dedicated low-privilege service account to limit the impact of code executed through deserialization.
  • Apply egress filtering to ML inference hosts to block command-and-control traffic from unexpected Python child processes.
bash
# Example allowlist filter applied before invoking hanlp.load
ALLOWED_PREFIX="hanlp."
CONFIG_PATH="/opt/models/config.json"

python - <<'PY'
import json, sys
cfg = json.load(open("/opt/models/config.json"))
cp = cfg.get("classpath", "")
if not cp.startswith("hanlp."):
    sys.exit("Rejected: untrusted classpath value: %s" % cp)
PY

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.