PT-2025-32158 · Hugging Face · Huggingface/Transformers

CVE-2025-5197

·

Published

2025-08-06

·

Updated

2026-07-07

CVSS v3.1

5.3

Medium

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Name of the Vulnerable Software and Affected Versions Hugging Face Transformers versions up to 4.51.3
Description A Regular Expression Denial of Service (ReDoS) vulnerability exists in the convert tf weight name to pt weight name() function of the Hugging Face Transformers library. This function, which converts TensorFlow weight names to PyTorch format, utilizes a regular expression pattern /[^/]* ([^/]*)/ susceptible to exploitation. Crafted input strings can trigger catastrophic backtracking, leading to excessive CPU consumption. This issue can result in service disruption, resource exhaustion, and potential vulnerabilities in API services that rely on model conversion between TensorFlow and PyTorch formats.
Recommendations Update to Hugging Face Transformers version 4.53.0 or later.

Exploit

Fix

DoS

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2025-5197
GHSA-9356-575X-2W9M
PYSEC-2026-1983

Affected Products

Huggingface/Transformers