Skip to content

Commit

Permalink
Merge pull request #5442
Browse files Browse the repository at this point in the history
dca799e Ignore getaddr messages on Outbound connections. (Ivan Pustogarov)
  • Loading branch information
laanwj committed Mar 9, 2015
2 parents f50120a + dca799e commit c1b723c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4021,7 +4021,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
}


else if (strCommand == "getaddr")
// This asymmetric behavior for inbound and outbound connections was introduced
// to prevent a fingerprinting attack: an attacker can send specific fake addresses
// to users' AddrMan and later request them by sending getaddr messages.
// Making users (which are behind NAT and can only make outgoing connections) ignore
// getaddr message mitigates the attack.
else if ((strCommand == "getaddr") && (pfrom->fInbound))
{
pfrom->vAddrToSend.clear();
vector<CAddress> vAddr = addrman.GetAddr();
Expand Down

0 comments on commit c1b723c

Please sign in to comment.