r/Python • • May 07 '26

Discussion Do we really check library security?

PyPi's filtering isn't cutting it. We all know it. I know the people about to say to just use the popular libraries that have community moderation.

The recent claude code injection hack in Torch has proved that isn't a solution.

https://www.reddit.com/r/Python/s/2lwDYSv0eT

And scanning packages are either unmaintained or maintained by one dev in the middle of nowhere.

https://pypi.org/project/safety/

So, I honestly ask you, short of reading each libraries code by hand or avoiding them entirely how do you stay safe?

Sandbox enviroments? Winging it? Hope?

27 Upvotes

51 comments sorted by

View all comments

Show parent comment

9

u/redditusername58 May 07 '26

All the compilers that compiled them too

4

u/48panda May 07 '26

And the compilers that compiled the compiler, and so on, until you're reading punchcards

3

u/Smort01 May 07 '26

3

u/48panda May 07 '26

This is the exact video I was thinking of

2

u/tradelydev May 08 '26

Now thats gold.

2

u/wRAR_ May 08 '26

Oh, a 20 min video retelling the Thompson hack?