Skip to content

Conversation

@davidebeatrici
Copy link

Previously all detected IP addresses were announced!

In addition to being a potentially serious privacy/security issue, that behavior poisons content retrieval because the node is only alive as long as download is in progress.

Previously all detected IP addresses were announced!

In addition to being a potentially serious privacy/security issue, that behavior poisons content retrieval because the node is only alive as long as download is in progress.
davidebeatrici added a commit to OpenMandrivaAssociation/ipget that referenced this pull request Jan 24, 2026
davidebeatrici added a commit to OpenMandrivaAssociation/ipget that referenced this pull request Jan 24, 2026
@davidebeatrici
Copy link
Author

After checking Kubo's code, I'm not sure this is the correct approach:

https://github.com/ipfs/kubo/blob/5ccdcdd4fca6654374e28d4ef4a16746c67e1938/config/addresses.go

package config

// Addresses stores the (string) multiaddr addresses for the node.
type Addresses struct {
	Swarm          []string // addresses for the swarm to listen on
	Announce       []string // swarm addresses to announce to the network, if len > 0 replaces auto detected addresses
	AppendAnnounce []string // similar to Announce but doesn't overwrite auto detected addresses, they are just appended
	NoAnnounce     []string // swarm addresses not to announce to the network
	API            Strings  // address for the local API (RPC)
	Gateway        Strings  // address to listen on for IPFS HTTP object gateway
}

https://github.com/ipfs/kubo/blob/5ccdcdd4fca6654374e28d4ef4a16746c67e1938/config/init.go#L102-L120

func addressesConfig() Addresses {
	return Addresses{
		Swarm: []string{
			"/ip4/0.0.0.0/tcp/4001",
			"/ip6/::/tcp/4001",
			"/ip4/0.0.0.0/udp/4001/webrtc-direct",
			"/ip4/0.0.0.0/udp/4001/quic-v1",
			"/ip4/0.0.0.0/udp/4001/quic-v1/webtransport",
			"/ip6/::/udp/4001/webrtc-direct",
			"/ip6/::/udp/4001/quic-v1",
			"/ip6/::/udp/4001/quic-v1/webtransport",
		},
		Announce:       []string{},
		AppendAnnounce: []string{},
		NoAnnounce:     []string{},
		API:            Strings{"/ip4/127.0.0.1/tcp/5001"},
		Gateway:        Strings{"/ip4/127.0.0.1/tcp/8080"},
	}
}

For reference, I discovered this issue because the ephemeral node with all IPv6 and IPv4 addresses of the machine I used to test ipget showed up on https://check.ipfs.network.

After applying this patch and fetching other CIDs it didn't seem to happen again.

What concerns me is that Kubo explicitly sets the IPv6 and IPv4 wildcards for each protocol in Addresses.Swarm, meaning that no addresses should be advertised when the config path is not set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant