Cybersecurity · · 2 min read

Hugging Face Security Incident: What You Need to Know

Hugging Face Security Incident: What You Need to Know

Hugging Face, renowned for its advancements in AI and machine learning, recently disclosed a security incident involving unauthorized access to its Spaces platform. This breach has raised concerns among users and developers who rely on the platform for hosting and deploying machine learning models. Here’s a detailed look at what happened, how Hugging Face responded, and what users should do to protect their data.

The Incident

On May 25, 2024, Hugging Face detected suspicious activity suggesting that some Spaces’ secrets might have been accessed without proper authorization. These secrets include sensitive data like tokens and credentials used by the platform to communicate securely with user applications. The breach prompted an immediate investigation to determine the extent of the exposure and the methods used by the unauthorized party.

Immediate Response

In response to the incident, Hugging Face took swift and comprehensive measures to mitigate the potential damage:

  1. Revocation of Compromised Tokens: All compromised Hugging Face (HF) tokens were revoked to prevent further unauthorized access. Users were advised to switch to fine-grained access tokens, which provide better security control and limit the scope of permissions.
  2. Enhanced Security Measures: The platform removed organization-wide tokens and implemented a robust key management service to ensure better protection of sensitive information. Additionally, Hugging Face enhanced its token leak detection mechanisms to promptly identify and address any future exposures.
  3. Notification and Communication: Hugging Face notified all affected users via email, providing detailed instructions on how to secure their accounts and generate new tokens. The company also made a public disclosure through their blog to maintain transparency and inform the broader community.

Lessons Learned and Improvements

The incident has been a learning opportunity for Hugging Face, prompting several key improvements to their security infrastructure:

  • Key Management Service: By integrating a more secure key management system, Hugging Face aims to reduce the risk of token leaks and unauthorized access.
  • Fine-Grained Access Tokens: Encouraging the use of fine-grained access tokens helps in limiting the permissions granted to applications, thereby minimizing potential damage from any future breaches.
  • Continuous Monitoring: Improved monitoring and detection systems are now in place to quickly identify and respond to suspicious activities.

What Users Should Do

If you are a user of Hugging Face’s Spaces platform, it’s crucial to take the following steps to ensure your data remains secure:

  1. Switch to Fine-Grained Tokens: Generate and use fine-grained access tokens instead of the deprecated organization-wide tokens. This change enhances security by limiting the permissions and scope of each token.
  2. Update Secrets and Credentials: Review and update any secrets or credentials that may have been compromised during the breach. This includes API keys, passwords, and other sensitive information.
  3. Monitor Account Activity: Keep an eye on your account for any unusual activity and report any suspicious actions to Hugging Face’s security team.


The recent security incident at Hugging Face serves as a stark reminder of the persistent threats in the digital landscape. While the company’s swift response and subsequent improvements highlight their commitment to security, it also underscores the importance of vigilance among users. By taking proactive steps to secure your data and staying informed about potential risks, you can help protect your applications and contribute to a safer online environment.

For more detailed information about the incident and the steps taken by Hugging Face, you can read the full disclosure here.

Stay safe and secure

Read next