Fix/885 update default bind address #892
Open
+336
−43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was wrong?
My previous PR #811 lacked the code changes on, multiple
examples
andcore
modules that were using wildcard addresses (0.0.0.0
) for binding, which could expose services on all network interfaces and create security vulnerabilities.How was it fixed?
I updated all the modules files and refactored to replace all wildcard bind addresses (
0.0.0.0
) with secure loopback addresses (127.0.0.1
) across the entire codebase:Examples Directory (17 files updated)
ping.py
,chat.py
,bootstrap.py
,mDNS.py
,pubsub.py
,random_walk.py
,identify.py
,identify_push_listener_dialer.py
examples/doc-examples/
directorynetwork_discover.py
(updated fallback functions)Core Library Updates
libp2p/utils/address_validation.py
: Updated fallback addresses from0.0.0.0
to127.0.0.1
Documentation Updates (5 files)
.rst
files indocs/examples.*.rst
to reflect new secure addressesTesting & Validation
tests/utils/test_default_bind_address.py
: Comprehensive tests for secure address selectiontests/examples/test_examples_bind_address.py
: Validation that all examples use secure addressesRelease Notes
newsfragments/885.feature.rst
: Security enhancement notificationTo-Do
cc: @acul71 @seetadev @pacrob