Hugging Face Transformers Improper Input Validation Vulnerability in Image Processing Utilities

Vulnerability

A vulnerability exists in Hugging Face Transformers in versions prior to 4.49.0, stemming from inadequate input validation in the 'image_utils.py' file. The issue arises from unsafe URL validation, which can be exploited by injecting usernames into URLs. This manipulation allows attackers to create URLs that seem to originate from YouTube but actually lead to harmful domains. Such an attack could facilitate phishing, malware distribution, or data exfiltration. The vulnerability has been addressed in version 4.52.1.

Impact

Exploitation of this vulnerability could result in phishing attacks, the spread of malware, or unauthorized data exfiltration.

Reproduction

To reproduce this vulnerability, craft a URL that includes a username injection, bypassing the 'startswith()' method used for URL validation. The manipulated URL should appear to be from YouTube but redirect to a malicious domain. This can be done by exploiting the improper validation in the image processing utilities of Hugging Face Transformers, specifically in the 'image_utils.py' file'.

Remediation

Users can upgrade to Hugging Face Transformers version 4.52.1 or later to address this vulnerability.

Added: Jul 7, 2025, 10:22 AM
Updated: Jul 7, 2025, 10:22 AM

Vulnerability Rating

Custom Algorithm
spread
6.6
impact
0.0
exploitability
4.0
remediation
7.7
relevance
0.2
threat
4.8
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.