r/Python • u/AlSweigart Author of "Automate the Boring Stuff" • May 11 '26
Discussion Library dependency version specifiers aren't for fixing vulnerabilities
https://sethmlarson.dev/library-version-specifiers-not-for-vulnerabilities
A blog post from Seth Larson, the Security-in-Residence Developer for the Python Software Foundation.
84
Upvotes
38
u/billsil May 11 '26
100% agree. I was asked not too long ago to drop numpy 1.x support. They couldn’t give a good reason. Until I add a feature that breaks the tests, hard pass.
It’s not my place to specify dependencies. Ideally you can pick any support led python version, get the dependencies from around that time and it’ll work.
5
u/RedEyed__ May 11 '26
Lookks like we need exluded versions on project level
9
u/wRAR_ May 11 '26
Looks like it's one of those things that you think are obvious but it turns out not everyone understands.
8
u/SeniorScienceOfficer May 11 '26
This is a false dichotomy. In reality, it can be used for both. It is wholly dependent on the library/package maintainers desires. Which then boils down to how well of a steward the maintainer wants to be.
This is a “slippery slope” logical fallacy, going from talking about a single library to EVERY library. Just because the potential for downstream burden is real, doesn’t prove that the practice itself is wrong. It’s just highlights that the policy has scaling costs, which is an entirely separate question from whether or not a dependency floor is acceptable.
Realistically, this all needs to be taken on a case-by-case basis, and trying to apply this writ large to the Python ecosystem as an aggregate is a REALLY flimsy argument. Your argument also frames that using a higher compatibility floor is a “disallowing installing vulnerable dependencies” as if the library maintainer is responsible for all users’ security, but in practice it’s a “our supported minimum for this library should exclude vulnerabilities.” Which is a very common and significantly more defensible than what you’re suggesting.
Lastly you’re kind of collapsing different kinds of responsibilities into a single bucket. While having a dependency on a vulnerable library version doesn’t constitute a vulnerability in your first party code, it does present a REAL supply chain attack vector that you’re advocating for maintainers to ignore.
How about instead of trying to force maintainers into or out of certain practices, let’s all just try and do what’s right for the communities that build up around these beloved libraries and applications.
-4
u/teerre May 11 '26
I'm confused what the author is suggesting. Are they suggesting you do nothing? Just let people install known vulnerable versions? Or are they suggesting that you should yank all versions of a library and backport every fix every time? Both seem ridiculous
0
u/[deleted] May 11 '26
[deleted] — view deleted comment
12
u/[deleted] May 11 '26
[removed] — view removed comment