CVE-2025-3777: Transformers Package Improper Input Validation Vulnerability

transformers Updated 02 Oct 2025

Summary

07/07/2025
Yes i
Low
3.5

CVE-2025-3777: Transformers's Improper Input Validation vulnerability can be exploited through username injection. Affects transformers versions < 4.52.1. Fixed in 4.52.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The Hugging Face Transformers package is a widely used library in the field of natural language processing (NLP) and machine learning. It provides pre-trained models and tools for tasks such as text classification, translation, and summarization. However, versions up to 4.49.0 are vulnerable to an improper input validation issue that can be exploited through malicious URL manipulation.

Vulnerability Detail

The vulnerability in the Transformers package is rooted in the improper validation of URLs within the image_utils.py file. The use of the 'startswith()' method for URL validation allows attackers to inject usernames into URLs, making them appear legitimate (e.g., from YouTube) while redirecting users to malicious domains. This can lead to serious consequences such as phishing attacks, malware distribution, or unauthorized data access.

How To Fix

Latest published version: 5.20.2 as of 22 Oct 2026

pip install --upgrade "transformers==5.20.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.52.1

This is the first release that contains the fix.

pip install --upgrade "transformers==4.52.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can implement additional validation checks for URLs in your application to prevent the exploitation of this vulnerability. For example, you can use regular expressions to validate URLs more securely.

Conclusion

The improper input validation vulnerability in the Hugging Face Transformers package poses significant risks, including potential phishing and malware attacks. It is crucial for users to update to version 4.52.1 or later to mitigate these risks. Regular monitoring of dependencies using tools like Vulert can help maintain security.

See every vulnerability recorded for transformers →

Share this vulnerability

FAQ

The CVSS score for this vulnerability is 3.5, indicating a low severity level.

All versions of the Transformers package up to 4.49.0 are affected by this vulnerability.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Exploitation of this vulnerability can lead to phishing attacks, malware distribution, or data exfiltration.

Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software using just the Pipfile.lock.

Related vulnerabilities

Recent vulnerabilities recorded for transformers.

How To Fix

Latest published version: 5.20.2 as of 22 Oct 2026

pip install --upgrade "transformers==5.20.2"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

4.52.1

This is the first release that contains the fix.

pip install --upgrade "transformers==4.52.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback