Potential linkage of public/private (anonymous) node addresses
The node only compared the incoming peer's id against the local node's id for that peer's own zone, but compared all zones on outgoing handshakes. An attacker could try to link a tor node to a public address by getting whitelisted and then answering future incoming connections with the tor node's id.
- Triaged in 7 days
- Fixed in 16 days
- Disclosed after 2 months
During the handshake for an incoming connection, the peer id is checked against the local node's peer id only for the specific zone of the incoming peer, in order to avoid linking public addresses to tor addresses: https://github.com/monero-project/monero/blob/5d7ae2d2791c0244a221872a7ac62627abb81896/src/p2p/net_node.inl#L2343
However, on handshakes for outgoing connections, all zones are checked: https://github.com/monero-project/monero/blob/5d7ae2d2791c0244a221872a7ac62627abb81896/src/p2p/net_node.inl#L1064
If an attacker wanted to link a specific tor node to a public node, they could potentially connect to as many public nodes as possible, get themselves added to the peer whitelist, maybe stuff some more attacker-owned addresses into the greylist, then disconnect, and for any future incoming connections, respond with the tor node's id in an attempt to link the public/tor addresses.
Low severity since it would probably take a while before they got lucky and the desired public node attempted an outgoing connection. But it would probably make sense to only check the right zone for outgoing handshakes as well to prevent such a possibility.
Also had another idea when brainstorming ways to link nodes, but it's more theoretical. An attacker could wait until a new release was about to drop, connect to as many nodes as possible, both public and tor, and log when disconnects occur. If a public node and tor node disconnect at the same time, it would be a pretty good indicator that they are the same node which was restarted due to the upgrade. Haven't thought of a way to mitigate such a timing attack yet.
Impact
Exposure of a tor node's public address
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the zone-specific peer id check is applied only to the incoming peer's zone on inbound handshakes, while outbound handshakes check all zones, so a peer id from another zone can still match.
Impact
A tor node's public address could be exposed, though the author rates this low severity because it would probably take a long time before the target public node made an outgoing connection.
What the attacker needed
Ability to run many connections; target node makes an outgoing connection; patience over a long period
The fix
The zone-specific check should also be applied to outgoing handshakes.
How it was found
- Connect to as many public nodes as possible and get added to the peer whitelist.
- Optionally add more attacker-owned addresses to the greylist.
- Disconnect, then answer future incoming connections with the tor node's id to try to link the public and tor addresses.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A node is a computer running the network software, and it can be reached over the normal internet or over Tor, which hides where it is. The software has a check meant to stop the same machine being recognised across both, but that check is weaker when the node itself dials out. So someone could try to work out that a hidden Tor node and a visible public node are the same machine.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.