From 7b484b2539eb7fc9d9ed811be5aefc70ba391d3a Mon Sep 17 00:00:00 2001 From: "admin@arionum.com" Date: Wed, 21 Jul 2021 17:54:13 +0300 Subject: [PATCH] block local peering attempts --- peer.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/peer.php b/peer.php index 2799531..818528b 100755 --- a/peer.php +++ b/peer.php @@ -42,6 +42,12 @@ if ($_POST['coin'] != $_config['coin']) { $ip = san_ip($_SERVER['REMOTE_ADDR']); $ip = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE); +// there should not be any local peering attempts +if($_SERVER['REMOTE_ADDR']==$_SERVER['SERVER_ADDR']){ + api_err("invalid-ip"); +} + + // peer with the current node if ($q == "peer") { // sanitize the hostname