Skip to content
Benderson Media
Markets
AAPL $241.52 -0.38%
BTC $97,412 +3.21%
MSFT $478.90 +0.67%
ETH $4,128 +1.89%
GOOGL $182.34 -0.52%
TSLA $312.67 +4.23%
META $621.45 +1.05%
S&P 500 $6,142.80 +0.31%
NASDAQ $20,847.50 +0.78%
NVDA $183.06 +2.14%

Hugging Face Got Broken Into and the Bear Stole the Keys

Hugging Face Got Broken Into and the Bear Stole the Keys
Image: TechCrunch | Source

Someone let the bear in. Hugging Face, which hosts over 1 million AI models according to the company’s own platform statistics, disclosed that attackers gained unauthorized access to their Spaces platform and walked off with user secrets including API tokens and private credentials. When the front door of AI development gets kicked open, everyone who stored their keys inside has a problem.

What Actually Happened

Think of Hugging Face Spaces as a campsite. Thousands of developers pitch tents there. They build apps, run models, and store their keys under the mat like everyone tells them not to. According to Hugging Face’s official security disclosure, attackers accessed Spaces secrets, which are the environment variables developers use to store API tokens and credentials. The company revoked a number of tokens and notified affected users.

Hugging Face hosts more than 500,000 datasets and serves millions of researchers and developers every month, according to their platform data. That scale means a breach of the Spaces environment is not just a developer inconvenience. It’s a potential supply chain event. When one compromised token connects to a production system, the campsite fire becomes a forest fire.

Security researchers at Wiz, who first flagged the exposure, found that the attack could have allowed access not just to individual secrets but potentially to shared inference infrastructure. According to Wiz’s published findings, the risk included cross tenant access, meaning one attacker with one stolen token could potentially reach other users’ environments.

The Bear Was Already Inside the Tent

Here is where the metaphor gets serious. This was not a bear rattling the fence from outside. The bear was already in the tent, going through the cooler. And most of the campers had no idea.

The AI developer community has a dangerous habit. According to a 2024 GitGuardian report, over 12.8 million secrets were exposed in public GitHub repositories in a single year. Developers copy tokens into environment variables, build systems, notebooks, and config files without thinking twice. Hugging Face Spaces made this easy. That ease became the vulnerability.

The rich versus poor mindset shows up clearly here. Developers who treat security as a cost center, something to deal with later, something that slows down shipping, got their honey stolen. Developers who treated their API tokens like cash in a vault, rotating them regularly, using temporary scoped credentials, and auditing their Spaces configs, kept their honey.

The bear does not care about your roadmap. The bear cares about what is in the cooler right now.

For teams building production AI products on top of models hosted through Hugging Face, the implications go beyond inconvenience. A stolen Anthropic API key runs up bills. A stolen AWS key deletes infrastructure. A stolen database credential hands over customer data. The average cost of a data breach reached $4.88 million in 2024 according to IBM’s Cost of a Data Breach Report. That number does not care whether you are a startup or a solo developer. The bear charges the same rate for everyone.

If you want to turn your AI security breakdowns into short video content for your audience without a production team, InVideo AI makes that a one person job. But video comes after you’ve actually secured the tent.

What I Would Do Right Now

I am not going to tell you to just rotate your tokens. You already know that. Let me tell you what actually moves the needle.

First, audit every secret you have stored in Hugging Face Spaces. Not just the ones you think are sensitive. All of them. Go through your environment variables like you’re checking every pocket before leaving for the airport. If a token has not been rotated in 90 days, rotate it today. If you do not recognize what a token connects to, revoke it immediately. The bear eats whatever it finds. Doesn’t matter if you forgot it was there.

Second, stop treating API tokens like they’re permanent. Machines should use temporary credentials with scoped permissions. A token that can read one S3 bucket should not also be able to write to your production database. Scope everything down to the minimum. Assume the bear is already studying your camp layout.

Third, set up billing alerts on every API provider. OpenAI, Anthropic, AWS, Google Cloud, all of them. A stolen token will start spending your money before you notice anything else is wrong. An alert at fifty percent of your normal spend gives you a fighting chance to catch it before the damage compounds. The bear always goes for the food first. Your budget is the food.

Fourth, rethink your attack surface on shared platforms. Hugging Face Spaces is a shared environment. So is Vercel. So is GitHub Codespaces. Any platform where your code runs next to other people’s code carries some level of shared risk. Treat anything stored there as potentially exposed and build your security model around that assumption.

If you want affordable security tooling to help with credential scanning and secret detection, AppSumo runs lifetime deals on exactly this category of software. I’ve picked up tools there that would cost hundreds per year on a subscription for a one-time price under a hundred dollars.

The Bottom Line

The bear broke into the most popular AI campsite on the internet. Not because the bear is especially smart. Because the campers left the cooler open for years and called it a feature. Rotate your keys. Scope your permissions. Audit your shared environments before the next bear finds your tent. And there will be a next bear. The only question is whether you’re ready when it shows up.

Frequently Asked Questions

What is the Hugging Face Spaces breach?

Hugging Face disclosed that attackers gained unauthorized access to their Spaces platform and accessed user secrets including API tokens and credentials. The company revoked affected tokens and notified users. According to Hugging Face, the breach involved secrets stored in the Spaces environment variables used by developers to build and run AI applications.

Was my Hugging Face account affected by the breach?

If you had secrets stored in Hugging Face Spaces, treat them as potentially exposed regardless of whether you received a notification. Hugging Face notified users it could identify as affected, but rotating all tokens and credentials stored on the platform is the safest response. Don’t wait for confirmation.

How do I protect my API keys after the Hugging Face breach?

Use temporary, scoped credentials instead of permanent tokens with broad permissions. Rotate tokens every 90 days at minimum, set up billing alerts on all API providers, and audit any secrets stored on shared platforms regularly. Never store production credentials in shared environments if you have an alternative.

What is cross tenant access and why does it matter in the Hugging Face breach?

Cross tenant access means one attacker’s compromised position could potentially reach other users on the same platform. According to Wiz’s published research on the Hugging Face breach, this was one of the risks identified in the attack. It matters because it turns a single point of entry into a platform-wide problem rather than an isolated one.

Is Hugging Face still safe to use after the breach?

Yes, with proper security habits. Hugging Face is still the largest public repository for AI models and datasets, and the breach was a lesson in how secrets are stored on shared platforms, not a reason to walk away. Treat any shared environment as potentially exposed, store secrets accordingly, and rotate credentials regularly.