CVE-2025-14924

Hugging · Hugging Face Transformers

A high-severity vulnerability has been identified in multiple Hugging Face products, specifically within the Transformers library.

Executive summary

A high-severity vulnerability has been identified in multiple Hugging Face products, specifically within the Transformers library. This flaw allows a remote attacker to execute arbitrary code on a server by tricking it into processing a maliciously crafted model file. Successful exploitation could lead to a complete system compromise, resulting in data theft, service disruption, or further network intrusion.

Vulnerability

The vulnerability exists within the model loading process for megatron_gpt2 architectures in the Hugging Face Transformers library. The root cause is the insecure deserialization of data from model files, likely using a method like Python's pickle module. An attacker can create a malicious model file containing embedded code and host it on a public repository or introduce it into a system's data pipeline. When the vulnerable library attempts to load this file, it deserializes the data and executes the embedded malicious code with the permissions of the application, leading to Remote Code Execution (RCE).

Business impact

This vulnerability is rated as High severity with a CVSS score of 7.8. A successful exploit grants an attacker the ability to execute code on the underlying server, bypassing security controls. The potential consequences include theft of sensitive intellectual property (such as proprietary models and training data), unauthorized access to sensitive business or customer data, deployment of ransomware, or using the compromised system as a pivot point to attack other internal network resources. The reputational damage and financial cost associated with a breach of critical AI/ML infrastructure can be significant.

Remediation

Immediate Action: Apply the security patches released by the vendor to all affected systems immediately, prioritizing internet-facing applications or those that process data from untrusted sources. After patching, monitor systems for any signs of exploitation that may have occurred prior to remediation by reviewing application and system access logs for anomalous activity.

Proactive Monitoring: Implement enhanced monitoring on affected systems. Look for suspicious child processes being spawned by the application, unexpected outbound network connections to unknown IP addresses, and anomalies in CPU or memory usage. Monitor file system integrity to detect unauthorized changes to model files or the creation of new executable files.

Compensating Controls: If patching cannot be immediately deployed, implement compensating controls. Restrict the application's ability to load models from untrusted or public sources. Enforce network segmentation to limit the compromised system's access to other parts of the network. Use application control or endpoint detection and response (EDR) solutions to block the execution of unauthorized commands or processes.

Exploitation status

Public Exploit Available: false

Analyst recommendation

This vulnerability presents a critical risk to the organization's AI/ML infrastructure and should be addressed with high priority. Although it is not currently listed on the CISA KEV catalog, its high CVSS score and the potential for complete system compromise warrant immediate action. We recommend that the vendor-supplied patches be applied within the organization's emergency patching window. Additionally, a security review should be initiated to audit all ML pipelines and ensure that only models from vetted, trusted sources are being used in production environments.