CVE-2025-14927: CWE-94: Improper Control of Generation of Code ('Code Injection') in Hugging Face Transformers
Hugging Face Transformers SEW-D 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-28252.
AI Analysis
Technical Summary
CVE-2025-14927 is a critical security vulnerability identified in the Hugging Face Transformers library, version 4.57.0. The flaw exists in the convert_config function, which improperly handles user-supplied strings by executing them as Python code without adequate validation or sanitization. This improper control of code generation (CWE-94) leads to a remote code execution (RCE) vulnerability, allowing an attacker to execute arbitrary commands on the affected system with the privileges of the user running the process. Exploitation requires user interaction, specifically the conversion of a maliciously crafted checkpoint file, which triggers the vulnerable code path. The vulnerability affects the confidentiality, integrity, and availability of the system, as attackers can execute arbitrary code, potentially leading to data theft, system compromise, or denial of service. The CVSS 3.0 base score is 7.8, reflecting high severity with local attack vector, low attack complexity, no privileges required, but user interaction needed. No public exploits have been reported yet, but the vulnerability poses a significant risk to environments leveraging Hugging Face Transformers for AI and machine learning tasks, especially where untrusted model checkpoints might be processed. The lack of a patch at the time of reporting necessitates immediate mitigation strategies to reduce exposure.
Potential Impact
For European organizations, the impact of CVE-2025-14927 can be substantial, particularly those involved in AI research, development, and deployment using Hugging Face Transformers. Successful exploitation could lead to unauthorized code execution, resulting in data breaches, intellectual property theft, disruption of AI services, and potential lateral movement within networks. Organizations relying on automated model conversion workflows or integrating third-party checkpoints without strict validation are at higher risk. The compromise of AI infrastructure could undermine trust in AI outputs and cause operational downtime. Given the widespread adoption of Hugging Face in Europe’s technology and research sectors, the vulnerability could affect a broad range of industries including finance, healthcare, automotive, and government agencies. The requirement for user interaction limits mass exploitation but targeted attacks against high-value entities remain a concern.
Mitigation Recommendations
To mitigate this vulnerability, European organizations should immediately audit their use of Hugging Face Transformers, especially version 4.57.0, and avoid converting model checkpoints from untrusted or unauthenticated sources. Until an official patch is released, implement strict input validation and sanitization on any user-supplied data involved in model conversion processes. Employ sandboxing or containerization to isolate the execution environment of model conversion tasks, limiting the potential impact of code execution. Monitor logs and system behavior for suspicious activity related to checkpoint processing. Educate users and developers about the risks of processing untrusted checkpoints and enforce policies restricting such actions. Stay updated with Hugging Face security advisories and apply patches promptly once available. Additionally, consider network segmentation and least privilege principles to minimize the attack surface and potential damage from exploitation.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland
CVE-2025-14927: CWE-94: Improper Control of Generation of Code ('Code Injection') in Hugging Face Transformers
Description
Hugging Face Transformers SEW-D 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-28252.
AI-Powered Analysis
Technical Analysis
CVE-2025-14927 is a critical security vulnerability identified in the Hugging Face Transformers library, version 4.57.0. The flaw exists in the convert_config function, which improperly handles user-supplied strings by executing them as Python code without adequate validation or sanitization. This improper control of code generation (CWE-94) leads to a remote code execution (RCE) vulnerability, allowing an attacker to execute arbitrary commands on the affected system with the privileges of the user running the process. Exploitation requires user interaction, specifically the conversion of a maliciously crafted checkpoint file, which triggers the vulnerable code path. The vulnerability affects the confidentiality, integrity, and availability of the system, as attackers can execute arbitrary code, potentially leading to data theft, system compromise, or denial of service. The CVSS 3.0 base score is 7.8, reflecting high severity with local attack vector, low attack complexity, no privileges required, but user interaction needed. No public exploits have been reported yet, but the vulnerability poses a significant risk to environments leveraging Hugging Face Transformers for AI and machine learning tasks, especially where untrusted model checkpoints might be processed. The lack of a patch at the time of reporting necessitates immediate mitigation strategies to reduce exposure.
Potential Impact
For European organizations, the impact of CVE-2025-14927 can be substantial, particularly those involved in AI research, development, and deployment using Hugging Face Transformers. Successful exploitation could lead to unauthorized code execution, resulting in data breaches, intellectual property theft, disruption of AI services, and potential lateral movement within networks. Organizations relying on automated model conversion workflows or integrating third-party checkpoints without strict validation are at higher risk. The compromise of AI infrastructure could undermine trust in AI outputs and cause operational downtime. Given the widespread adoption of Hugging Face in Europe’s technology and research sectors, the vulnerability could affect a broad range of industries including finance, healthcare, automotive, and government agencies. The requirement for user interaction limits mass exploitation but targeted attacks against high-value entities remain a concern.
Mitigation Recommendations
To mitigate this vulnerability, European organizations should immediately audit their use of Hugging Face Transformers, especially version 4.57.0, and avoid converting model checkpoints from untrusted or unauthenticated sources. Until an official patch is released, implement strict input validation and sanitization on any user-supplied data involved in model conversion processes. Employ sandboxing or containerization to isolate the execution environment of model conversion tasks, limiting the potential impact of code execution. Monitor logs and system behavior for suspicious activity related to checkpoint processing. Educate users and developers about the risks of processing untrusted checkpoints and enforce policies restricting such actions. Stay updated with Hugging Face security advisories and apply patches promptly once available. Additionally, consider network segmentation and least privilege principles to minimize the attack surface and potential damage from exploitation.
Affected Countries
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- zdi
- Date Reserved
- 2025-12-18T20:49:54.276Z
- Cvss Version
- 3.0
- State
- PUBLISHED
Threat ID: 694b064e4eddf7475afca17f
Added to database: 12/23/2025, 9:14:54 PM
Last enriched: 12/23/2025, 9:19:02 PM
Last updated: 12/26/2025, 7:19:12 PM
Views: 4
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.