Pypi Blog: Token Exfiltration Campaign via Github Actions Workflows
Posted4 months agoActive3 months ago
blog.pypi.orgTechstory
calmmixed
Debate
60/100
SecurityGithub ActionsPypiCi/cd
Key topics
Security
Github Actions
Pypi
Ci/cd
A recent attack campaign targeted GitHub Actions workflows to exfiltrate PyPI tokens, prompting a discussion on security best practices and the effectiveness of Trusted Publishing.
Snapshot generated from the HN discussion
Discussion Activity
Moderate engagementFirst comment
N/A
Peak period
8
90-96h
Avg / period
2.9
Comment distribution20 data points
Loading chart...
Based on 20 loaded comments
Key moments
- 01Story posted
Sep 16, 2025 at 5:09 PM EDT
4 months ago
Step 01 - 02First comment
Sep 16, 2025 at 5:09 PM EDT
0s after posting
Step 02 - 03Peak activity
8 comments in 90-96h
Hottest window of the conversation
Step 03 - 04Latest activity
Sep 20, 2025 at 7:14 PM EDT
3 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45268084Type: storyLast synced: 11/20/2025, 1:35:57 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
It's wild to me that people entrust a third-party CI system with API secrets, and then also entrust that same system to run "actions" provided by other third parties.
the CI system itself encourages you to import random third party code into your CI workflow, based on mutable tags
which then receives full privileges
the entire thing is insane
so very few use it
it's not made obvious that the tag isn't immutable
although you might be happy with the contents of what you've imported right now, who says it won't be malicious in a year's time
people inadvertently give full control of their build and all their secrets to whoever controls that repository (now, and in the future)
making it easy to do the right thing is an important part of API design and building secure systems, and these CI systems fail miserably there
https://github.blog/changelog/2025-08-26-releases-now-suppor...
sigstore's main design goal seems to be to increase the lock-in of of "trusted" providers
(the idea that Microsoft should be trusted for anything requiring any level of security is entirely ludicrous)
https://socket.dev/blog/pypi-package-disguised-as-instagram-...
https://socket.dev/blog/monkey-patched-pypi-packages-steal-s...
https://socket.dev/blog/malicious-pypi-package-targets-disco...
https://socket.dev/blog/typosquatting-on-pypi-malicious-pack...
However, exfiltrating a token is much more easy than modifying the workflow itself. A token is usually simply stored in an env variable.
In the specific case of the attack described in the blog post, though, the attackers added an extra GitHub Actions workflow that sent the token to an external server. That means they had enough privileges to change GHA workflows, and could just as easily change a workflow that used Trusted Publishing.
(It may be possible to configure branch protections or rules limiting who/when can trigger the Trusted Publishing workflow, but it's about as difficult as limiting the secret tokens to only be available to some maintainers.)
I’m also glad to see yet another case where having Trusted Publishing configured would have prevented the attack. That’s a cheap defense that has proven effective once again!