Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Misc/NEWS.d/next/Library/2025-05-15-14-27-01.gh-issue-134062.fRbJet.rst OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
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 buthash()
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
to264bf69
Compare
These tests were introduced for the previous CVE: cpython/Lib/test/test_ipaddress.py Lines 2753 to 2763 in62f66ca
I added some tests in a separate commit. Feel free to drop it if you don't think the tests are valuable. |
264bf69
to492c579
Comparebedevere-bot commentedMay 17, 2025
🤖 New build scheduled with the buildbot fleet by@gpshead for commit492c579 🤖 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. |
f3fc0c1
intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks@mssalvatore for the PR, and@gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10, 3.11, 3.12, 3.13, 3.14. |
…ythonGH-134063)(cherry picked from commitf3fc0c1)Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>pythongh-134062: Fix hash collisions in IPv4Network and IPv6Networkpythongh-134062: Add hash collision regression test
…ythonGH-134063)(cherry picked from commitf3fc0c1)Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>pythongh-134062: Fix hash collisions in IPv4Network and IPv6Networkpythongh-134062: Add hash collision regression test
GH-134476 is a backport of this pull request to the3.14 branch. |
…ythonGH-134063)(cherry picked from commitf3fc0c1)Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>pythongh-134062: Fix hash collisions in IPv4Network and IPv6Networkpythongh-134062: Add hash collision regression test
GH-134477 is a backport of this pull request to the3.13 branch. |
…ythonGH-134063)(cherry picked from commitf3fc0c1)Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>pythongh-134062: Fix hash collisions in IPv4Network and IPv6Networkpythongh-134062: Add hash collision regression test
GH-134478 is a backport of this pull request to the3.12 branch. |
GH-134479 is a backport of this pull request to the3.11 branch. |
…ythonGH-134063)(cherry picked from commitf3fc0c1)Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>pythongh-134062: Fix hash collisions in IPv4Network and IPv6Networkpythongh-134062: Add hash collision regression test
…ythonGH-134063)(cherry picked from commitf3fc0c1)Co-authored-by: Mike Salvatore <mike.s.salvatore@gmail.com>pythongh-134062: Fix hash collisions in IPv4Network and IPv6Networkpythongh-134062: Add hash collision regression test
GH-134480 is a backport of this pull request to the3.10 branch. |
GH-134481 is a backport of this pull request to the3.9 branch. |
Uh oh!
There was an error while loading.Please reload this page.