-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-134062: Fix hash collisions in IPv4Network and IPv6Network #134063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
mssalvatore
commented
May 15, 2025
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: Excessive hash collisions in IPv4Network and IPv6Network classes #134062
Misc/NEWS.d/next/Library/2025-05-15-14-27-01.gh-issue-134062.fRbJet.rst
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, a regression test would be good but hash()
is an implementation detail, making it CPython-only (I don't know how PyPy and co implement it), and if we don't already have a test for the similar issue you found, there's no need for one.
I can add a regression test. |
Let's add a test where we manually craft the values that are hashed. I'm however unsure whether If there wasn't a test introduced for the previous CVE, just don't bother with a test. |
eeabe2a
to
264bf69
Compare
These tests were introduced for the previous CVE: cpython/Lib/test/test_ipaddress.py Lines 2753 to 2763 in 62f66ca
I added some tests in a separate commit. Feel free to drop it if you don't think the tests are valuable. |
264bf69
to
492c579
Compare
🤖 New build scheduled with the buildbot fleet by @gpshead for commit 492c579 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F134063%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |