r/Python • • 13d ago

News microsoft agent-framework on PyPI was compromised twice in 33 minutes last night

1.26.1 and 1.26.2 both ship a credential stealer. It runs from a .pth file, so it executes at interpreter startup. Nothing has to import the package, a pip install in CI is enough. 1.26.1 got pulled, then 1.26.2 went up 33 minutes later with the same payload under different file names. Last clean release is 1.26.0.
complete details- https://safedep.io/blog/microsoft-agent-framework-pypi-compromise

461 Upvotes

57 comments sorted by

View all comments

71

u/russellvt 13d ago

And they laughed when I said "CI/CD without enforced code review" would be an issue someday.

7

u/rzet 12d ago

what could go wrong

4

u/russellvt 12d ago

Honestly, I figured "stealing credentials" might be less of an issue than people simply injecting automatically tested mergeable code ... but, with people's general ineptitude with including those sorts of pieces in their repositories, it may even be a bit worse.

1

u/Valcorb 12d ago

In case of a dependency version upgrade, Is it the reviewer's responsability to track if the new version is a compromised one? I wouldnt blame this on AI code review, its a bad setup if your project instantly updates to the newest versions without an age or confidence check

1

u/russellvt 12d ago

I think you misunderstand "code review" and where it's mostly useful/applicable.

This is why there's code coverage tests, and why those branches should generally be locked from anyone that's not a core contributor... not to mention, the master branch as a whole.

TLDR; Test Driven Development is truly "the future" - and a key trait of old senior developers.

This is doubly true for people who support key modules.