CVE-2025-14928: CWE-94: Improper Control of Generation of Code ('Code Injection') in Hugging Face Transformers
Hugging Face Transformers HuBERT convert_config Code Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Hugging Face Transformers. User interaction is required to exploit this vulnerability in that the target must convert a malicious checkpoint. The specific flaw exists within the convert_config function. The issue results from the lack of proper validation of a user-supplied string before using it to execute Python code. An attacker can leverage this vulnerability to execute code in the context of the current user. Was ZDI-CAN-28253.
AI Analysis
Technical Summary
CVE-2025-14928 is a critical security vulnerability identified in the Hugging Face Transformers library, version 4.57.0, specifically within the convert_config function related to the HuBERT model. The vulnerability is classified as CWE-94, indicating improper control of code generation, commonly known as code injection. The root cause is the lack of proper validation of user-supplied strings before executing them as Python code. This flaw allows a remote attacker to craft a malicious checkpoint file that, when converted by the vulnerable function, triggers execution of arbitrary Python code in the context of the current user. Exploitation requires user interaction, meaning the target must actively convert a malicious checkpoint, which may occur in workflows that accept external or third-party model files. The vulnerability affects confidentiality, integrity, and availability, as arbitrary code execution can lead to data theft, system compromise, or service disruption. The CVSS v3.0 score is 7.8 (high severity), with attack vector local (requiring user interaction), low attack complexity, no privileges required, and high impact on all security properties. No public exploits have been reported yet, but the vulnerability is published and should be considered a serious risk for environments using Hugging Face Transformers for natural language processing or machine learning tasks. The absence of patches at the time of reporting necessitates immediate mitigation steps.
Potential Impact
For European organizations, the impact of CVE-2025-14928 can be significant, especially those leveraging Hugging Face Transformers in AI, NLP, or machine learning pipelines. Successful exploitation could lead to unauthorized code execution, resulting in data breaches, intellectual property theft, or disruption of critical AI services. Organizations processing external or untrusted model checkpoints are particularly vulnerable, as attackers can embed malicious payloads within these files. The compromise could extend to broader network infiltration if the attacker gains persistent access. Given the growing adoption of AI technologies across sectors such as finance, healthcare, and manufacturing in Europe, this vulnerability poses a risk to sensitive data and operational continuity. Additionally, regulatory frameworks like GDPR impose strict data protection requirements, and exploitation could lead to compliance violations and reputational damage.
Mitigation Recommendations
To mitigate CVE-2025-14928, European organizations should immediately avoid using Hugging Face Transformers version 4.57.0 for converting model checkpoints until a patched version is released. Implement strict validation and sanitization of all user-supplied inputs, especially checkpoint files, before processing. Employ sandboxing or containerization to isolate the execution environment of model conversion processes, limiting the potential damage from code execution. Monitor and restrict file sources to trusted repositories only, and enforce strict access controls on systems running vulnerable software. Conduct security awareness training to inform users about the risks of processing untrusted model files. Additionally, organizations should track updates from Hugging Face for patches and apply them promptly once available. Incorporating runtime application self-protection (RASP) or endpoint detection and response (EDR) solutions can help detect anomalous behaviors indicative of exploitation attempts.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland
CVE-2025-14928: CWE-94: Improper Control of Generation of Code ('Code Injection') in Hugging Face Transformers
Description
Hugging Face Transformers HuBERT convert_config Code Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Hugging Face Transformers. User interaction is required to exploit this vulnerability in that the target must convert a malicious checkpoint. The specific flaw exists within the convert_config function. The issue results from the lack of proper validation of a user-supplied string before using it to execute Python code. An attacker can leverage this vulnerability to execute code in the context of the current user. Was ZDI-CAN-28253.
AI-Powered Analysis
Technical Analysis
CVE-2025-14928 is a critical security vulnerability identified in the Hugging Face Transformers library, version 4.57.0, specifically within the convert_config function related to the HuBERT model. The vulnerability is classified as CWE-94, indicating improper control of code generation, commonly known as code injection. The root cause is the lack of proper validation of user-supplied strings before executing them as Python code. This flaw allows a remote attacker to craft a malicious checkpoint file that, when converted by the vulnerable function, triggers execution of arbitrary Python code in the context of the current user. Exploitation requires user interaction, meaning the target must actively convert a malicious checkpoint, which may occur in workflows that accept external or third-party model files. The vulnerability affects confidentiality, integrity, and availability, as arbitrary code execution can lead to data theft, system compromise, or service disruption. The CVSS v3.0 score is 7.8 (high severity), with attack vector local (requiring user interaction), low attack complexity, no privileges required, and high impact on all security properties. No public exploits have been reported yet, but the vulnerability is published and should be considered a serious risk for environments using Hugging Face Transformers for natural language processing or machine learning tasks. The absence of patches at the time of reporting necessitates immediate mitigation steps.
Potential Impact
For European organizations, the impact of CVE-2025-14928 can be significant, especially those leveraging Hugging Face Transformers in AI, NLP, or machine learning pipelines. Successful exploitation could lead to unauthorized code execution, resulting in data breaches, intellectual property theft, or disruption of critical AI services. Organizations processing external or untrusted model checkpoints are particularly vulnerable, as attackers can embed malicious payloads within these files. The compromise could extend to broader network infiltration if the attacker gains persistent access. Given the growing adoption of AI technologies across sectors such as finance, healthcare, and manufacturing in Europe, this vulnerability poses a risk to sensitive data and operational continuity. Additionally, regulatory frameworks like GDPR impose strict data protection requirements, and exploitation could lead to compliance violations and reputational damage.
Mitigation Recommendations
To mitigate CVE-2025-14928, European organizations should immediately avoid using Hugging Face Transformers version 4.57.0 for converting model checkpoints until a patched version is released. Implement strict validation and sanitization of all user-supplied inputs, especially checkpoint files, before processing. Employ sandboxing or containerization to isolate the execution environment of model conversion processes, limiting the potential damage from code execution. Monitor and restrict file sources to trusted repositories only, and enforce strict access controls on systems running vulnerable software. Conduct security awareness training to inform users about the risks of processing untrusted model files. Additionally, organizations should track updates from Hugging Face for patches and apply them promptly once available. Incorporating runtime application self-protection (RASP) or endpoint detection and response (EDR) solutions can help detect anomalous behaviors indicative of exploitation attempts.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- zdi
- Date Reserved
- 2025-12-18T20:49:58.765Z
- Cvss Version
- 3.0
- State
- PUBLISHED
Threat ID: 694b064e4eddf7475afca182
Added to database: 12/23/2025, 9:14:54 PM
Last enriched: 12/23/2025, 9:18:49 PM
Last updated: 12/26/2025, 7:19:11 PM
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console in Console -> Billing for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.