Inefficient Regular Expression Complexity Affecting text-generation-inference package, versions <3.3.6-r0


Severity

Recommended
low

Based on default assessment until relevant scores are available.

Threat Intelligence

EPSS
0.08% (24th 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 Learn

Learn about Inefficient Regular Expression Complexity vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-CHAINGUARDLATEST-TEXTGENERATIONINFERENCE-13600364
  • published17 Oct 2025
  • disclosed6 Aug 2025

Introduced: 6 Aug 2025

CVE-2025-5197  (opens in a new tab)
CWE-1333  (opens in a new tab)

How to fix?

Upgrade Chainguard text-generation-inference to version 3.3.6-r0 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 Regular Expression Denial of Service (ReDoS) vulnerability exists in the Hugging Face Transformers library, specifically in the convert_tf_weight_name_to_pt_weight_name() function. This function, responsible for converting TensorFlow weight names to PyTorch format, uses a regex pattern /[^/]*___([^/]*)/ that can be exploited to cause excessive CPU consumption through crafted input strings due to catastrophic backtracking. The vulnerability affects versions up to 4.51.3 and is fixed in version 4.53.0. This issue can lead to service disruption, resource exhaustion, and potential API service vulnerabilities, impacting model conversion processes between TensorFlow and PyTorch formats.