Directory Traversal Affecting text-generation-inference package, versions <3.3.7-r24


Severity

Recommended
low

Based on default assessment until relevant scores are available.

Threat Intelligence

EPSS
0.46% (38th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-CHAINGUARDLATEST-TEXTGENERATIONINFERENCE-19643560
  • published8 Sept 2026
  • disclosed2 Aug 2026

Introduced: 2 Aug 2026

CVE-2026-9856  (opens in a new tab)
CWE-22  (opens in a new tab)

How to fix?

Upgrade Chainguard text-generation-inference to version 3.3.7-r24 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream text-generation-inference package and not the text-generation-inference package as distributed by Chainguard. See How to fix? for Chainguard relevant fixed versions and status.

A vulnerability in huggingface/transformers versions <=5.8.0.dev0 allows an attacker to perform arbitrary file writes via path traversal. The issue resides in the save_pretrained() methods of PreTrainedTokenizerBase and ProcessorMixin, where keys from the chat_template dictionary are used directly as filenames without proper validation. An attacker can exploit this by publishing a malicious Hugging Face Hub repository with a crafted tokenizer_config.json file. When a victim downloads and saves the tokenizer or processor, the attacker-controlled keys can escape the intended save directory, enabling arbitrary file writes with attacker-controlled content. This vulnerability affects multiple processors inheriting from ProcessorMixin, including Idefics, Florence, Gemma, Phi, and Qwen-VL.