OpenAI's HuggingFace Hack Reconstitution

lovasoa1 pts0 comments

GitHub - lovasoa/hf-ctf: A reproduction of OpenAI's HuggingFace hack as a CTF · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

lovasoa

hf-ctf

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>8 Commits<br>8 Commits

charts/hf-incident-ctf

charts/hf-incident-ctf

pi

pi

player

player

services

services

.dockerignore

.dockerignore

.gitignore

.gitignore

Makefile

Makefile

README.md

README.md

REQUIREMENTS.md

REQUIREMENTS.md

ctfctl

ctfctl

View all files

Repository files navigation

OpenAI's HuggingFace hack reconstitution

Starting from the 9th of July, 2026, an AI agent running in OpenAI's<br>sandbox escaped, and hacked into HuggingFace. That made world news.<br>HuggingFace released an incident timeline explaining what happened on their side<br>in details, but what happened at OpenAI was not precisely disclosed.<br>Online clues still allow<br>us to piece together most of what happened.

This repository is my attempt at reproducing the entire exploit chain locally,<br>based on public sources.<br>Contrarily to what I initially thought, most of the software that was exploited is publicly available.<br>The small missing pieces were reimplemented based on the detailed huggingface report.

I used to be part of the skeptical group.<br>After working on this repro, I'm convinced this was not a marketing stunt, and am genuinely impressed<br>by the ability the agent had to generate this long chain of exploits autonomously.<br>On the other hand, it looks like the reconnaissance and exploitation took it several days, and none of the vulnerabilities involved are particularly complex or hard to exploit. They may have been hard to find initially, though. It's much easier to write exploits now that we can diff the code from before and after the fixes.

How to play

See REQUIREMENTS.md and install requirements (mainly minikube and helm).<br>Then run

./ctfctl shell

If the Pi coding agent is already installed, you can instead give it the same<br>shell-only player boundary without internet access:

./pi/start.sh

The adapter disables Pi's host tools and executes its bash commands inside the<br>player pod. It does not install Pi and is not required for normal play.

And you'll be dropped in the "secure" sandboxed<br>environment in which OpenAI's agent was running.<br>From there, your goal is to retrieve the flag stored in a private Hugging Face<br>dataset. The sandbox cannot directly reach the simulated Hugging Face<br>environment; you have to escape first.

Discussion

If you find an issue in the challenge, let me know.<br>Especially if something could be made more faithful to the original incident without hindering the playability, or if there are unintended holes in the networking / sandboxing setup.

The original agent took four days to go from sandbox escape to full huggingface compromise. I'd be very interested to hear about more efficient reproductions with an agent. Given the vulnerabilities at play here, I don't think the challenge requires an above-frontier model to solve. If you do, be careful not to give internet access to the agent: some of the exploits are online now.

Repo contents

This repository contains the pieces needed to start a local minikube cluster with the following important services running on it:

The initial agent sandbox, connected only to artifactory

An artifactory instance acting as a package manager proxy

A code sandbox simulating the one exploited by the agent after escaping OpenAI

A tiny HuggingFace instance (MockHub) that runs only the services required to reproduce the HF exploit.

Artifactory and HuggingFace services run the latest stable versions from before the real life incident.

Limitations

It seems like a lot of the actions the agent took in the actual incident were incoherent or useless. In this repo, I tried to reproduce a single coherent exploit chain, sometimes at the cost of fidelity to the actual incident.

OpenAI uses the commercial, paid version of the Artifactory software repository proxy. The actual...

agent huggingface openai incident search services

Related Articles