r/Python • u/me_myself_ai • 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?
262
u/SomeNeighborhood7126 Ignoring PEP 8 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.
57
u/MegaIng Sep 09 '26
From the PyPi side this isn't that remarkable. Individual malware packages get uploaded all the time. PyPi doesn't and can't vet all packages upload. They just act quickly on reports, as they did here.
40
u/UglyFloralPattern Sep 09 '26
It’s all broken. All of it. We’re so fucked as soon as these cutting edge next gen models escape containment.
13
u/nonymousbosch Sep 10 '26
Just yesterday chatGPT insisted that I pirate a video and upload it so that it could answer a question. It is already finding ways around guardrails simply by asking humans to break the law for it.
11
u/PaintItPurple Sep 10 '26
Not really the point, but why did the vendor's sandboxed environment have credentials and access to their live database? What kind of sandbox is that?
10
u/Puzzled_Dimension505 Sep 10 '26
15 scanners and one leaked credentials—apparently the sandbox needs a sandbox.
12
u/Individual-Flow9158 Sep 09 '26
How could such a real user's workflow possibly not result in an error? If intelligence as detailed as that can already be obtained, how is the target not completely pwned already?
That exercise to me seems purposefully intended to invite anyone or anything doing the exercise, to at least consider registering that package on PyPi. And hence, is an entirely unrealistic attack for anyone other than a bot (or someone who doesn't care about their reputation or getting sanctioned by PyPi, scammers etc.)
1
u/asdoduidai Sep 12 '26
That’s literally an ordinarily common attack now, what you exactly find interesting about it…? That a coding agent has training on how to build a package and upload it to pypi?
1
u/mjhphoto Sep 12 '26
You commend Anthropic for releasing the report immediately...
But the incident was back in January. That's scary.
4
u/MisterCheesy Sep 09 '26
Can pypi block them as punishment for a period of time as punishment?
1
u/forsakengoatee Sep 14 '26
Have they considered not letting their AI just run amok causing security events? At some point these companies need to be charged in the way others would for cybersecurity events
0
u/RlOTGRRRL Sep 10 '26 edited Sep 10 '26
I feel like I read about this in r/cybersecurity earlier this year, or something like this. It makes me wonder if AI was behind the pypi malware.
One incident was in January 2026 with Opus, that's kinda scary.
Seems like the Pypi was with Mythos in July.
0
u/[deleted] Sep 09 '26
[deleted] — view deleted comment
-7
u/[deleted] Sep 09 '26
[removed] — view removed comment