CVE-2025-3777: Transformers: URL validation bypass exposes image pipeline
GHSA-phhr-52qp-3mj4 LOW PoC AVAILABLE CISA: TRACK*HuggingFace Transformers (≤4.49.0) has a URL validation flaw in image_utils.py where startswith() checks can be bypassed via URL username injection (e.g., https://attacker.com@youtube.com). Low severity in isolation, but any pipeline that processes untrusted image URLs—fine-tuning jobs, multimodal inference, dataset ingestion—is a potential exfiltration vector. Upgrade to 4.52.1; if upgrade is blocked, validate URLs server-side before passing to the library.
What is the risk?
Risk is LOW-MEDIUM in practice. CVSS 3.5 and EPSS 0.021% reflect the low base severity and minimal active exploitation. However, exposure is broad: Transformers is installed in millions of ML environments, and the affected code path (image URL loading) is common in multimodal workflows. The attack requires an adversary to inject a crafted URL into the pipeline, which narrows the attack surface to systems that process untrusted image inputs. Not in CISA KEV; no known active exploitation.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Transformers | pip | — | No patch |
| Transformers | pip | < 4.52.1 | 4.52.1 |
How severe is it?
What is the attack surface?
What should I do?
5 steps-
Patch
Upgrade transformers to ≥4.52.1 immediately (pip install --upgrade transformers).
-
Workaround
Implement allowlist-based URL validation before passing URLs to transformers—use urllib.parse to extract and verify the netloc component, not startswith().
-
Detection
Audit pipeline code for calls to image_utils or any transformers function accepting external image URLs. Search for patterns like load_image(url) with user-supplied input.
-
Network controls
Restrict egress from ML training/inference nodes—unexpected outbound connections to non-CDN domains are a signal.
-
SBOM check
If running transformers in containers or managed environments, trigger a dependency update cycle.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-3777?
HuggingFace Transformers (≤4.49.0) has a URL validation flaw in image_utils.py where startswith() checks can be bypassed via URL username injection (e.g., https://attacker.com@youtube.com). Low severity in isolation, but any pipeline that processes untrusted image URLs—fine-tuning jobs, multimodal inference, dataset ingestion—is a potential exfiltration vector. Upgrade to 4.52.1; if upgrade is blocked, validate URLs server-side before passing to the library.
Is CVE-2025-3777 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-3777, increasing the risk of exploitation.
How to fix CVE-2025-3777?
1. **Patch**: Upgrade transformers to ≥4.52.1 immediately (pip install --upgrade transformers). 2. **Workaround**: Implement allowlist-based URL validation before passing URLs to transformers—use urllib.parse to extract and verify the netloc component, not startswith(). 3. **Detection**: Audit pipeline code for calls to image_utils or any transformers function accepting external image URLs. Search for patterns like load_image(url) with user-supplied input. 4. **Network controls**: Restrict egress from ML training/inference nodes—unexpected outbound connections to non-CDN domains are a signal. 5. **SBOM check**: If running transformers in containers or managed environments, trigger a dependency update cycle.
What systems are affected by CVE-2025-3777?
This vulnerability affects the following AI/ML architecture patterns: multimodal training pipelines, image-based fine-tuning workflows, model serving with image URL inputs, dataset ingestion pipelines, MLOps automation pipelines.
What is the CVSS score for CVE-2025-3777?
CVE-2025-3777 has a CVSS v3.1 base score of 3.5 (LOW). The EPSS exploitation probability is 0.33%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0011.003 Malicious Link AML.T0025 Exfiltration via Cyber Means AML.T0074 Masquerading Compliance Controls Affected
What are the technical details?
Original Advisory
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.
Exploitation Scenario
An adversary targeting an organization running a multimodal fine-tuning pipeline (e.g., dataset processing with BLIP or CLIP) submits a poisoned dataset entry containing a crafted image URL: https://huggingface.co@attacker-c2.com/payload.jpg. The pipeline's image_utils.py validates the URL with startswith('https://huggingface.co'), passes the check, and fetches the resource from attacker-c2.com. The request includes environment metadata (cloud instance headers, OAuth tokens in HTTP headers if misconfigured). The attacker's server logs the incoming request and extracts any exfiltrated credentials or internal network routing information. In a CI/CD-integrated training pipeline, this can run unmonitored at scale.
Weaknesses (CWE)
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.
- [Architecture and Design] Consider using language-theoretic security (LangSec) techniques that characterize inputs using a formal language and build "recognizers" for that language. This effectively requires parsing to be a distinct layer that effectively enforces a boundary between raw input and internal data representations, instead of allowing parser code to be scattered throughout the program, where it could be subject to errors or inconsistencies that create weaknesses. [REF-1109] [REF-1110] [REF-1111]
- [Architecture and Design] Use an input validation framework such as Struts or the OWASP ESAPI Validation API. Note that using a framework does not automatically address all input validation problems; be mindful of weaknesses that could arise from misusing the framework itself (CWE-1173).
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:N/A:N References
- github.com/advisories/GHSA-phhr-52qp-3mj4
- github.com/huggingface/transformers/blame/a7d2bbaaa8aac64f7c1ee8c1421cfe84b38359a4/src/transformers/image_utils.py
- nvd.nist.gov/vuln/detail/CVE-2025-3777
- github.com/huggingface/transformers/commit/4dda5f71b35fb70cf602187eef84bb17a50b9082 Patch
- huntr.com/bounties/ccba0730-9248-4853-b7ff-5c20e6364f09 Exploit 3rd Party
- github.com/ARPSyndicate/cve-scores Exploit
- github.com/doublegate/Claude-AGI Exploit
Timeline
Related Vulnerabilities
CVE-2026-26210 9.8 KTransformers: pickle RCE via unauthenticated ZMQ socket
Same package: transformers CVE-2024-3568 9.6 HuggingFace Transformers: RCE via pickle deserialization
Same package: transformers CVE-2026-5241 9.6 transformers: trust_remote_code bypass enables RCE via model load
Same package: transformers CVE-2024-11393 8.8 Transformers: RCE via MaskFormer model deserialization
Same package: transformers CVE-2023-6730 8.8 HuggingFace Transformers: RCE via unsafe deserialization
Same package: transformers