CVE-2025-3777: Transformers Package Username Injection Vulnerability

transformers Updated 07 Jul 2026

Summary

07/07/2026
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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Hugging Face Transformers is a popular open-source library designed for natural language processing tasks. It provides pre-trained models and tools for tasks such as text classification, translation, and image processing. The library is widely used in the AI community due to its ease of use and extensive capabilities. However, versions up to 4.49.0 are susceptible to a critical vulnerability that compromises its URL validation mechanism.

Vulnerability Detail

The vulnerability in the Transformers package arises from improper input validation in the image_utils.py file. Specifically, the use of the 'startswith()' method for URL validation can be bypassed through username injection. This allows attackers to craft malicious URLs that masquerade as legitimate YouTube links, potentially leading to phishing attacks, malware distribution, or data exfiltration. The vulnerability has a CVSS score of 3.5, indicating a moderate level of risk.

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, users can implement additional validation checks on URLs before processing them. For example, you can manually verify that the URL does not contain any unexpected username components. However, the best solution is to update to the patched version.

Conclusion

The improper input validation vulnerability in the Hugging Face Transformers package poses a significant risk to users. It is crucial to update to the latest version to mitigate potential threats. By following the provided steps, users can ensure their applications remain secure.

See every vulnerability recorded for transformers →

Share this vulnerability

FAQ

The vulnerability is an improper input validation issue that allows for username injection in URLs.

All versions up to 4.49.0 are affected by this vulnerability.

Attackers could exploit this vulnerability to conduct phishing attacks, distribute malware, or exfiltrate sensitive data.

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

Vulert is a tool that monitors and alerts in real-time for open-source vulnerabilities in 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