Back to the notes

One letter typo bypassed HuggingFace's admin API

A researcher changed 'organization' to 'organisations' in an API path and got admin access. Plural vs singular broke authentication.

01equipment.jpg
Alice Wondrak-Biel / Wikimedia Commons. Resized and converted to WebP. Public domain

A security researcher found a way past HuggingFace’s admin API by changing one letter in the URL path. The working endpoint checked permissions. The typo endpoint did not. The difference: /api/organization/ versus /api/organisations/. One is singular, one is plural. The plural route existed but skipped the auth middleware. Full admin access with a British spelling. This is the API equivalent of finding an unlocked back door because the builder forgot to wire the alarm to it. HuggingFace runs model hosting for half the ML community. An unauthenticated admin endpoint is not a theoretical problem. The bug sits in routing logic. Most frameworks match /api/organization/:id and /api/organisations/:id as separate routes. If you write middleware for one but forget the other, or if someone adds a typo alias for backwards compatibility, you get a bypass. The code probably looked fine in isolation. Authentication was on the main route. But HTTP does not care about your naming conventions. I have written plural and singular routes in the same codebase. It happens when you are matching external API conventions or when British and American English collide in the spec. The fix is not to never have aliases. The fix is to test auth on every route that touches sensitive data, not just the one you think users will hit. The researcher disclosed this responsibly. HuggingFace patched it. But the reminder stands: your security model has to cover every path into the system, including the ones that exist by accident.


Source: Changing one letter bypassed an admin API in HuggingFace

Back to all notes

Behind the notes

Vikrant
Sharma.

Artificial Intelligence Engineer intern at Voxon Photonics in Adelaide. Studying a Master of Information and Communications Technology at UniSC, with a focus on data, machine learning and security.

Meet the person behind the work