---
id: "CVE-2026-122014"
kind: "vulnerability"
aliases: ["CVE-2026-122014"]
title: "npcpy: model fine-tuning loader lets remote input run injected code"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "open"
category: "ai-tooling"
products: [{"name": "npcpy", "fixed": [], "affected": "<= 2.1.27", "ecosystem": "pypi"}]
ecosystems: []
tags: ["ai-tooling", "fine-tuning", "llm", "npcpy", "pypi", "python", "trust-remote-code"]
not_affected_if: ["hard-coded-model-path", "no-sft-usage", "trusted-adapters-only"]
published_at: "2026-11-04T21:18:07+00:00"
first_seen_at: "2026-11-04T21:49:18+00:00"
updated_at: "2026-11-04T22:13:30+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-122014", "first_seen_at": "2026-11-04T21:49:18+00:00"}, {"source": "analyst", "url": "https://github.com/NPC-Worldwide/npcpy/issues/308", "first_seen_at": "2026-11-04T21:52:45+00:00", "cites": ["https://github.com/NPC-Worldwide/npcpy/issues/308", "https://pypi.org/project/npcpy/"]}]
exploit_sources: []
---

# npcpy: model fine-tuning loader lets remote input run injected code

load_sft_model() in npcpy/ft/sft.py reads base_model_name_or_path from the adapter's adapter_config.json and passes it to from_pretrained with trust_remote_code=True hardcoded. If the named base-model repo ships a modeling_*.py file, it runs in the loading process before the adapter weights load. The reporter's PoC shows this. As of 2026-11-04 the issue is open and the latest release (2.1.27) is still listed as affected.

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

## Affected

- pypi:npcpy affected <= 2.1.27 fixed ?

## How to check

- Run `pip show npcpy`: 2.1.27 and earlier are affected, and 2.1.27 is the latest release, so no fixed version exists yet.
- Search your code for `load_sft_model` (also used by npcpy/ft/model_ensembler.py). Check whether the adapter directory or Hub repo id you pass in can come from someone you do not trust.
- Open the adapter's adapter_config.json and check that base_model_name_or_path points to a base model you chose. Look for auto_map entries and .py files in that base repo.

## Timeline

- 2026-11-04T21:49:18+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-122014
- 2026-11-04T21:52:45+00:00 analyst https://github.com/NPC-Worldwide/npcpy/issues/308 — Primary: maintainer-repo issue #308 (researcher 3em0, PoC; maintainer cagostino acknowledged 2026-10-11, no fix yet). PyPI/GitHub latest is 2.1.27, so no fixed release. NVD says remote attack; actual trigger is loading a poisoned adapter. Nothing marked verified (researcher report, not a vendor advisory). Posts not searched.

## Documents

- [advisory] load_sft_model() hardcodes trust_remote_code=True (npcpy #308) https://github.com/NPC-Worldwide/npcpy/issues/308
- [mentions] npcpy on PyPI (latest 2.1.27) https://pypi.org/project/npcpy/

## From the sources

A vulnerability has been found in NPC-Worldwide npcpy up to 2.1.27. This affects the function load_sft_model of the file npcpy/ft/sft.py. The manipulation of the argument base_model_name_or_path leads to code injection. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used.

---

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