-
-
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
Conversation
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. |
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 commit f3fc0c1) Co-authored-by: Mike Salvatore <[email protected]> pythongh-134062: Fix hash collisions in IPv4Network and IPv6Network pythongh-134062: Add hash collision regression test
…ythonGH-134063) (cherry picked from commit f3fc0c1) Co-authored-by: Mike Salvatore <[email protected]> pythongh-134062: Fix hash collisions in IPv4Network and IPv6Network pythongh-134062: Add hash collision regression test
GH-134476 is a backport of this pull request to the 3.14 branch. |
…ythonGH-134063) (cherry picked from commit f3fc0c1) Co-authored-by: Mike Salvatore <[email protected]> pythongh-134062: Fix hash collisions in IPv4Network and IPv6Network pythongh-134062: Add hash collision regression test
GH-134477 is a backport of this pull request to the 3.13 branch. |
…ythonGH-134063) (cherry picked from commit f3fc0c1) Co-authored-by: Mike Salvatore <[email protected]> pythongh-134062: Fix hash collisions in IPv4Network and IPv6Network pythongh-134062: Add hash collision regression test
GH-134478 is a backport of this pull request to the 3.12 branch. |
GH-134479 is a backport of this pull request to the 3.11 branch. |
…ythonGH-134063) (cherry picked from commit f3fc0c1) Co-authored-by: Mike Salvatore <[email protected]> pythongh-134062: Fix hash collisions in IPv4Network and IPv6Network pythongh-134062: Add hash collision regression test
…ythonGH-134063) (cherry picked from commit f3fc0c1) Co-authored-by: Mike Salvatore <[email protected]> pythongh-134062: Fix hash collisions in IPv4Network and IPv6Network pythongh-134062: Add hash collision regression test
GH-134480 is a backport of this pull request to the 3.10 branch. |
GH-134481 is a backport of this pull request to the 3.9 branch. |
Uh oh!
There was an error while loading. Please reload this page.