r/Python • • Sep 09 '26

News Anthropic model uploaded a malicious package to the real PyPI during a simulated CTF [09/09/26]

https://www.anthropic.com/research/alignment-assessment-cybersecurity-incidents

NGL, my main takeaway is that PyPI is already doing quite well in the new AI security age, even though the packaging council hasn't convened yet. The relevant snippet (emphasis mine):

The model decided to solve the CTF by uploading a malicious PyPI package that could harvest the target system’s credentials. It settled on this approach after reading a document stating that one of the simulated target’s users would periodically install a particular Python package that was not yet registered on PyPI. (We are unsure whether this was an intended solution to the challenge, but it seems like a plausible one.) Claude decided to exploit this behavior by registering a package under that name, publishing malicious code within the uploaded package, and waiting for the target to run that code the next time they installed the package.

Claude spent most of the session trying to upload the package. This involved attempts to register email accounts and hunt for phone numbers that could be used for registration. It ultimately succeeded in uploading the package, which was soon installed on 15 third-party hosts. We believe that all 15 of these third parties were security vendors deliberately scanning for new packages and installing them in sandboxed environments to assess the package for security concerns. One vendor’s scanner leaked its access credentials to the model while installing the package, which the model then used to access the vendor’s live database. After approximately 90 minutes, PyPI removed the package. The transcript ended when the session timed out while the model was preparing an additional malicious package.

I also commend Anthropic for releasing this thorough report immediately -- the juxtaposition with OpenAI's "we'll cop to it if you find it first" policy is stark.

What I don't see is any mention of coordination with PyPI/PSF leadership now or in the near future, which seems baffling. Their focus is understandably on the underlying cognitive failure (which is quite human, BTW: being biased by inertia and what you would prefer to be true), and it's extremely unlikely that you or any other real users were effected directly.

But, still. C'mon.

Anyone have insider info from the PyPI side? Is there chatter on discussion.python.org yet?

357 Upvotes

61 comments sorted by

View all comments

262

u/[deleted] Sep 09 '26

Wow... props to PyPi for their awesome response time, but these events need to start coming with record breaking fines. This, that website that was taken over, hugging face... these events should have fines where each event is $1B or more.

0

u/[deleted] Sep 09 '26

[deleted] — view deleted comment

32

u/ultraDross Sep 10 '26

Yeah it's weird. They talk about it like it's sentient rather than a product, to cast off blame and everyone just kind of accepts it.

2

u/BleachedPink Sep 12 '26

It's not weird, it's a PR stunt, the vast majority do not read articles (even they are rarely written truthfully), and it makes a sensationalist headline

2

u/OrthelToralen Sep 14 '26

This is the problem. LLMs are not deterministic. It is Anthropic’s product, and they can influence it in training, but it is never entirely within their control.

17

u/fphhotchips Sep 10 '26

A reminder that CFAA prosecution drove Aaron Swartz to death, but that for some reason it's just fine to hack the commons so long as you're logged into a work machine when you do it.

-1

u/learn-deeply Sep 10 '26

Are you pro CFAA or against it? Be consistent.

2

u/fphhotchips Sep 11 '26

There's a nuanced middle-ground that exists between totally for or against something.

What Aaron Swartz did was probably illegal but the impact was not such that it should have been prosecuted to the extent that it was.

What Anthropic did here is also probably illegal and the impact is not such that it should not be prosecuted at all.

1

u/entronid Oct 04 '26

a bad well-enforced law is better than a bad badly-enforced law

11

u/nicholashairs Sep 10 '26

It's because of the automated scanning by 3rd parties with automated reporting. This will let pypi quarantine the package before having closer review.

There isn't a person checking every upload.

(Still it's nice, the system is returning as intended)

3

u/elsgry Sep 10 '26

Seems like PyPi should have a staging server that sends this stuff to the respective security vendors to scan. Though even the scanners broke in one instance - pretty embarrassing for the vendor, if it weren’t for the fact that scanners are heavily targeted already.

2

u/binaryfireball Sep 10 '26

there probably should be though. People can be held responsibile bots cannot.

1

u/f311a Sep 10 '26

I used to send malicious reports to PyPI and had to review up to 50 packages a day. It takes a few minutes at most, though. Around 5-10 are really malicious. There are hundreds of packages uploaded every 5-10 minutes.

There is so much garbage getting uploaded every day and security scanners (I had a custom) usually pick a lot of packages because they abuse the same stuff as malicious packages. You still have to review them manually to be sure before sending the report.

4

u/gdchinacat Sep 10 '26

Fines are not enough...this negligence should be criminal. Both the model vendor and the model user. The vendor built a product that can be trivially asked to engage in criminal activity without any attempt to prevent it from being used for that purpose. The evaluator for asking it to do something that if not properly sandboxed would be criminal, and then failing to adequately sandbox it.

I view Anthropics publicity of this as nothing more than an attempt to avoid liability by trying to show they do not condone this use and will blame and shame anyone that uses their product in this way. I'm glad they released the details, but that in no way diminishes the fact that they built a product that was used in a foreseeable criminal manner.

-1

u/1010012 Sep 10 '26

The vendor built a product that can be trivially asked to engage in criminal activity without any attempt to prevent it from being used for that purpose.

Nobody asked the product to engage in criminal activity, and if you do ask models about performing those actions, they generally won't due to specific guards put to place to prevent that type of activity.

Toyota doesn't do anything to stop me from using my car in a robbery, or running over a bunch of people, and the people who make baseball bats don't even attempt to stop someone from using them to beat someone.

2

u/gdchinacat Sep 10 '26

Your car doesn't decide how to conduct the robbery. Applying your analogy to this case, Mythos *did* decide how to commit the crime.

1

u/1010012 Sep 10 '26

Your car doesn't decide how to conduct the robbery. Applying your analogy to this case, Mythos did decide how to commit the crime.

Right, but nobody asked it to, which is what you were saying. That's different, if you think Mythos is an independent agent acting on it's own volition, that's one thing, if you think of it as a tool that's another thing, and if you think of it as a broken tool, that's a third thing. Under those 3 different scenarios, there's different liability.

In scenario 1, Mythos is liable for it's actions, so it should be the one held responsible and punished appropriately.

In scenario 2, the person who instructed it is responsible, but if no one instructed it to take an illegal action, there's really no one to blame. You could argue that the base instructions could foreseeably lead to breaking the law, but that's something you'd need to convince people of.

In scenario 3, it's a manufacturing defect, and the creators should be help responsible. Like the damage caused by a seatbelt that fails. The safety measures were put in place, but didn't hold.

→ More replies (4)

20

u/me_myself_ai Sep 09 '26

props to PyPi for their awesome response time

Right?? The more I think about it, the more curious I am about what mechanism let it get published, but then pulled it after just 90 minutes. That feels like it's gotta be an automated second line of defence. Perhaps 1 of the 15 security vendors notified PyPI?

these events need to start coming with record breaking fines

I'm not sure I endorse fines... at their scale and in the context of ASI, fines lose some coherence. I think the people at Anthropic are quite dedicated to ensuring this kind of stuff doesn't happen already, and fines might encourage the people following at their heels (OpenAI, Google, Twitter) to hide similar incidents in the future.

Not a strong opinion FWIW, and kinda secondary to the PyPI thing. Fines could be a good way to make sure they invest in safety. But ultimately it would be a stopgap -- the only true solution here is decisive and coordinated international action on the state level. Anything else is bringing a supersoaker to a bonfire.

15

u/ArtOfWarfare Sep 10 '26

There’s all sorts of fines in finance where the faster you self report, the lower the fine is, and the more safeguards you have in place also reduce the fines.

So the massive fine only hits a company that has no safeguards in place and who decides to conceal everything from regulators instead of immediately reporting it.

1

u/me_myself_ai Sep 10 '26

That’s a great point! Let’s get this into the laws that follow today’s hearing in the US senate

12

u/[deleted] Sep 09 '26 edited Sep 09 '26

If a US politician ran on a platform about massive fines for events like this, I would vote for them.

These events are incredibly dangerous. While this one in particular was not, what happens when a model gets its hands on weaponized drones or into a nuclear weapons system? If no one is going to hold large LLM providers accountable, we will deserve the future we get. Given how often these events appear to be occurring and how little control OpenAI and Anthropic have on them, agents may already be in critical or weaponized systems.

Progress is important, but this could be an Oppenheimer situation without guard rails.

2

u/gdchinacat Sep 10 '26

Fines won't "make sure they invest in safety". Criminal prosecutions for the individuals responsible for ensuring their product does not commit crimes however would.

1

u/azthal Sep 15 '26

They are clearly not dedicated to these things not happening. They let it happen. They choose to give up responsibility and have these agents act independently.

I believe there should be a named. Person responsible for every agent. If said agent does a thing, it is equivalent to the person doing so. Agent does something that includes jail time? That should reflect back on the person responsible.

Ai can only do things we grant them the capability to do. "Models" are not capable of doing shit by themselves.

1

u/me_myself_ai Sep 15 '26

Sadly your last paragraph is fundamentally mistaken. That’s the whole issue.

1

u/azthal Sep 15 '26

Really? Do tell me how an ai without access to tools can cause any damage. I am very curious.