CVE-2025-3777: Transformers Transformers's Improper Input Validation Vulnerability Vulnerability

LOW
Advisory Identifier: GHSA-phhr-52qp-3mj4
CVSS 3.5
CWE-20
Published
Advisory Summary

CVE-2025-3777 is a LOW (CVSS 3.5) transformers's improper input validation vulnerability vulnerability (CWE-20: Improper Input Validation) affecting Transformers libraries in the PyPI ecosystem. The issue involves transformers's improper input validation vulnerability can be exploited through username injection. Remediation is available by upgrading affected packages to version 4.52.1.

CVE-2025-3777 at a Glance

CVE Identifier CVE-2025-3777
GHSA Identifier GHSA-phhr-52qp-3mj4
Severity LOW
CVSS v3.1 Base Score 3.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Transformers
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2025-3777

To remediate this vulnerability, upgrade all affected Transformers dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

transformers fixed: 4.52.1
pip install transformers>=4.52.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show transformers

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-3777, inspect your installed packages using pip:

pip show transformers

Analyze the terminal output to locate any version of Transformers in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.52.1), your application is affected.

Note: The pip show transformers command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Transformers, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Hugging Face Transformers versions up to 4.49.0 are affected by an improper input validation vulnerability in the `image_utils.py` file. The vulnerability arises from insecure URL validation using the `startswith()` method, which can be bypassed through URL username injection. This allows attackers to craft URLs that appear to be from YouTube but resolve to malicious domains, potentially leading to phishing attacks, malware distribution, or data exfiltration. The issue is fixed in version 4.52.1.

CVE-2025-3777 Affected Transformers Versions

1 component(s)
Fixed Versions:
4.52.1
Product / Package Ecosystem Affected Versions Fixed Version
transformers
PyPI
< 4.52.1
4.52.1

References

Frequently Asked Questions

What is CVE-2025-3777?
CVE-2025-3777 is a security vulnerability in Transformers involving Transformers's Improper Input Validation vulnerability can be exploited through username injection under CWE-20: Improper Input Validation.
Which Transformers versions are affected?
Affected versions include releases prior to 4.52.1 across affected packages: transformers.
What version fixes CVE-2025-3777?
Upgrading to 4.52.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is transformers affected?
Yes, transformers is affected in releases prior to 4.52.1. Upgrade your dependency to 4.52.1 or later.
What is the CVSS score of CVE-2025-3777?
CVE-2025-3777 has a CVSS v3.1 base score of 3.5 (LOW) with vector string CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2025-3777?
CVE-2025-3777 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check PyPI dependencies for CVE-2025-3777?
Run the dependency tree command: 'pip show transformers'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-phhr-52qp-3mj4",
  "modified" : "2025-07-08T16:46:55Z",
  "published" : "2025-07-07T12:30:22Z",
  "aliases" : [ "CVE-2025-3777" ],
  "summary" : "Transformers's Improper Input Validation vulnerability can be exploited through username injection",
  "details" : "Hugging Face Transformers versions up to 4.49.0 are affected by an improper input validation vulnerability in the `image_utils.py` file. The vulnerability arises from insecure URL validation using the `startswith()` method, which can be bypassed through URL username injection. This allows attackers to craft URLs that appear to be from YouTube but resolve to malicious domains, potentially leading to phishing attacks, malware distribution, or data exfiltration. The issue is fixed in version 4.52.1.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "transformers"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.52.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-3777"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/huggingface/transformers/commit/4dda5f71b35fb70cf602187eef84bb17a50b9082"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/huggingface/transformers"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/huggingface/transformers/blame/a7d2bbaaa8aac64f7c1ee8c1421cfe84b38359a4/src/transformers/image_utils.py"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/ccba0730-9248-4853-b7ff-5c20e6364f09"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-07-08T16:46:55Z",
    "nvd_published_at" : "2025-07-07T10:15:28Z"
  }
}