Listen to this Post
2025-02-06
Hugging Face, a widely-used platform for community-driven AI development, continues to face significant security risks as researchers uncover vulnerabilities in machine-learning models hosted on the platform. The focus of the latest findings is the abuse of Python-based pickle files, which, while commonly used for storing and sharing machine-learning models, have been identified as an effective attack vector for malicious actors. ReversingLabs researchers recently discovered that at least two machine-learning models on Hugging Face contained harmful web shells linked to hardcoded IP addresses, made possible by the exploitation of pickle file deserialization.
the Issue
- Researchers at ReversingLabs discovered two machine-learning models on Hugging Face containing malicious pickle files.
- Pickle files are commonly used in AI development for serializing and deserializing code but can be exploited to execute arbitrary Python code.
- These malicious files deployed web shells and linked to hardcoded IP addresses, which could be used for remote control.
- Although Hugging Face is aware of pickle-related vulnerabilities, its security tool, Picklescan, struggled to detect the malicious files.
- The attack method, based on a new pickling technique, was identified as a potential proof of concept, though the threat remains genuine.
- Despite Hugging Faceās security measures, including the Picklescan tool and a warning about pickle vulnerabilities, the evolving nature of threats continues to challenge platform security.
What Undercode Says:
Hugging Faceās exposure to pickle-based attacks highlights a growing cybersecurity concern in the AI and machine learning community. As the platform hosts an increasing number of community-developed models, its reliance on shared pickle files, a common format in Python programming, has become a double-edged sword. While pickle files facilitate efficient sharing of AI models, they also present a significant security risk when used maliciously.
In the cases discovered by ReversingLabs, attackers exploited the pickle file deserialization process to execute harmful code that was undetectable by existing security tools. Deserialization in Python occurs when a file is read and converted into an executable format, but without a prior comprehensive validation, it poses a substantial risk of running malicious scripts from untrusted sources. The Picklescan tool used by Hugging Face to detect these malicious files relies on blacklists of dangerous functions, which, while useful, are not foolproof. The dynamic nature of threats, with new and evolving attack methods, renders such blacklists inadequate for handling novel attack vectors like the one discovered.
The
As AI development platforms continue to grow, the security landscape must evolve in tandem. Open-source platforms like Hugging Face are particularly susceptible to attacks because of their community-driven nature. The ease of sharing and building on pre-trained models is crucial for accelerating AI progress, but it also opens the door for cybercriminals to introduce hidden threats. The pickle vulnerability is just one example of a broader issue in machine-learning model sharing. Malicious actors can embed malware in seemingly benign models, exploiting the trust developers place in shared code.
Looking ahead, the development of more sophisticated security measures for shared AI models will be crucial. Blacklists like Picklescanās are only the first step in addressing pickle vulnerabilities. More advanced techniques, such as dynamic analysis of code execution during deserialization and the use of machine learning itself to identify anomalies in model behavior, will be key to staying ahead of malicious actors.
Additionally, the broader AI community must adopt a more robust security-first mindset, with developers taking extra precautions when working with third-party models. This includes verifying the integrity of pickle files before use, utilizing sandbox environments for model execution, and continuously monitoring the execution of shared code for any unusual activity.
The ongoing pickle file vulnerability in Hugging Face demonstrates the growing intersection between cybersecurity and AI development. While platforms like Hugging Face provide valuable resources for the AI community, they must also invest in evolving security frameworks to protect their users from an increasingly sophisticated threat landscape.
References:
Reported By: https://cyberscoop.com/hugging-face-platform-continues-to-be-plagued-by-vulnerable-pickles/
https://www.facebook.com
Wikipedia: https://www.wikipedia.org
Undercode AI: https://ai.undercodetesting.com
Image Source:
OpenAI: https://craiyon.com
Undercode AI DI v2: https://ai.undercode.help