Executive brief
Hugging Face Transformers is a widely-used machine learning library for NLP and computer vision tasks. A deserialization flaw in the handling of configuration files allows remote code execution if a user opens a malicious model file or visits a crafted webpage. This gives attackers complete control over the user's system and any data the application can access.
Technical details
This vulnerability exists in the MobileViTV2 configuration file handling within Hugging Face Transformers. The root cause is insufficient validation of user-supplied data during deserialization, which allows untrusted serialized objects to be reconstructed without proper integrity checks. The attack vector is network-based with high attack complexity, requiring user interaction—the victim must visit a malicious page or open a malicious model file. Once triggered, an attacker can execute arbitrary code in the context of the current user. The vulnerability affects all versions prior to 4.48.0, which includes the fix. The fix involves removing insecure conversion scripts from release wheels and properly validating configuration data during deserialization.
Affected products
- Hugging Face Transformers < 4.48.0
Timeline
- 2024-11-19: disclosed
- 2024-11-23: patched: Version 4.48.0 released with fix