Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

core/network-libp2p: possible spoofing of NAT traversed addresses #1193

Closed
Eenae opened this issue Dec 3, 2018 · 6 comments
Closed

core/network-libp2p: possible spoofing of NAT traversed addresses #1193

Eenae opened this issue Dec 3, 2018 · 6 comments
Labels
I2-security The client fails to follow expected, security-sensitive, behaviour.
Milestone

Comments

@Eenae
Copy link

Eenae commented Dec 3, 2018

When processing Identified event from a peer here observed address of the current node is added to a list as reported by the peer. During the addition only basic checks are performed on the libp2p level.

Malicious node can spoof other nodes observed addresses which as a result will be added to listening_addrs and announced further by the node itself, potentially hindering node connectivity.

I suggest to introduce some form of quorum checking on observed addresses as a simplest solution.

@tomaka tomaka added this to the 1.0 (final) milestone Dec 3, 2018
@gavofyork gavofyork added the I2-security The client fails to follow expected, security-sensitive, behaviour. label Dec 18, 2018
@tomaka
Copy link
Contributor

tomaka commented Jan 10, 2019

This is far from being a trivial problem.

To give an illustration, at the moment I can't see any way of differentiating between a maliciously-reported IP address and a legitimate address in the local 192.168.x.x range.
Both can be visible only to a part of the network, and therefore any measure against malicious IP addresses will also apply to the 192.168.x.x address.

I'm not an expert on that topic, but as far as I know some NATs will sometimes happily rewrite IP addresses that belong to the outside of the network as well. A "bad" IP can therefore come from a legitimate implementation that is behind one of these NATs.

@Eenae
Copy link
Author

Eenae commented Jan 11, 2019

Agree.

Looks like local subnets need special treatment and separate consensus on address validity per subnet (hopefully a host can reliably determine in which subnets it participates). By the way, announcing local ip reported by subnet fellow to external world is a bad idea anyway, so there should be some handling.

I'm not an expert on that topic, but as far as I know some NATs will sometimes happily rewrite IP addresses that belong to the outside of the network as well.

I think rewrite of src address of incoming packet won't cause problems, and I doubt any software will deep-inspect and rewrite addresses in L7 payload. Or am I missing something in this case?

@tomaka
Copy link
Contributor

tomaka commented Jan 11, 2019

I think rewrite of src address of incoming packet won't cause problems, and I doubt any software will deep-inspect and rewrite addresses in L7 payload. Or am I missing something in this case?

The problem is that these nodes would report back bad external IPs, and I don't know how we would filter that.

One possible quick fix for now is to sort addresses by the number of times they have been reported. Addresses are attempted in the order in which they are announced, and so nodes would first try the addresses which the majority agrees on.

@Demi-Marie
Copy link
Contributor

@tomaka could we just declare that nodes in such networks are not allowed to participate in the public blockchain, or can only participate in a read-only mode?

@Demi-Marie
Copy link
Contributor

I have a friend who is a professional network administrator. I will ask him about this question.

@gavofyork gavofyork modified the milestones: 1.1, Ideas Nov 28, 2019
@tomaka
Copy link
Contributor

tomaka commented Apr 14, 2020

I'm going to close this issue as duplicate of paritytech/polkadot-sdk#564 which is more recent and contains more details.

@tomaka tomaka closed this as completed Apr 14, 2020
liuchengxu pushed a commit to liuchengxu/substrate that referenced this issue May 31, 2023
…e-provider

Fix Parity DB storage provider
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I2-security The client fails to follow expected, security-sensitive, behaviour.
Projects
None yet
Development

No branches or pull requests

4 participants