VirtueMart Forum

VirtueMart 2 + 3 => Virtuemart Development and bug reports => Topic started by: tantedante on October 16, 2015, 02:55:58 am

Title: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: tantedante on October 16, 2015, 02:55:58 am
Hello,
I use VirtueMart 3.0.2 in a Joomla 3.3.6 site.
Yesterday I got a mail, that there is an error with one paypal payment.
That is the content of the "paypal.2.log.php" log:
Code: [Select]
#
#
2015-10-15 19:23:58 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 173.0.81.1, 10.19.1.100.
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address
            These are the valid IP Addresses: 23.57.113.223,173.0.81.1,173.0.81.33,216.113.188.202,216.113.188.203,216.113.188.204,66.211.170.66,173.0.88.66,173.0.88.98,173.0.84.66,173.0.84.98,173.0.80.00,173.0.80.01,173.0.80.02,173.0.80.03,173.0.80.04,173.0.80.05,173.0.80.06,173.0.80.07,173.0.80.08,173.0.80.09,173.0.80.10,173.0.80.11,173.0.80.12,173.0.80.13,173.0.80.14,173.0.80.15,173.0.80.16,173.0.80.17,173.0.80.18,173.0.80.19,173.0.80.20,173.0.82.126,173.0.88.67,173.0.88.99,173.0.84.99,173.0.84.67,173.0.88.69,173.0.88.101,173.0.84.69,173.0.84.101,173.0.88.68,173.0.88.100,173.0.84.68,173.0.84.100,173.0.81.1,173.0.81.33,64.4.240.0,64.4.240.1,64.4.240.2,64.4.240.3,64.4.240.4,64.4.240.5,64.4.240.6,64.4.240.7,64.4.240.8,64.4.240.9,64.4.240.10,64.4.240.11,64.4.240.12,64.4.240.13,64.4.240.14,64.4.240.15,64.4.240.16,64.4.240.17,64.4.240.18,64.4.240.19,64.4.240.20,118.214.15.186,118.215.103.186,118.215.119.186,118.215.127.186,118.215.15.186,118.215.151.186,118.215.159.186,118.215.167.186,118.215.199.186,118.215.207.186,118.215.215.186,118.215.231.186,118.215.255.186,118.215.39.186,118.215.63.186,118.215.7.186,118.215.79.186,118.215.87.186,118.215.95.186,202.43.63.186,69.192.31.186,72.247.111.186,88.221.43.186,92.122.143.186,92.123.151.186,92.123.159.186,92.123.163.186,92.123.167.186,92.123.179.186,92.123.183.186The Order ID received was: 420d028

2015-10-16 00:20:24 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 173.0.81.1, 10.19.1.100.
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address
            These are the valid IP Addresses: 23.57.113.223,173.0.81.1,173.0.81.33,216.113.188.202,216.113.188.203,216.113.188.204,66.211.170.66,173.0.88.66,173.0.88.98,173.0.84.66,173.0.84.98,173.0.80.00,173.0.80.01,173.0.80.02,173.0.80.03,173.0.80.04,173.0.80.05,173.0.80.06,173.0.80.07,173.0.80.08,173.0.80.09,173.0.80.10,173.0.80.11,173.0.80.12,173.0.80.13,173.0.80.14,173.0.80.15,173.0.80.16,173.0.80.17,173.0.80.18,173.0.80.19,173.0.80.20,173.0.82.126,173.0.88.67,173.0.88.99,173.0.84.99,173.0.84.67,173.0.88.69,173.0.88.101,173.0.84.69,173.0.84.101,173.0.88.68,173.0.88.100,173.0.84.68,173.0.84.100,173.0.81.1,173.0.81.33,64.4.240.0,64.4.240.1,64.4.240.2,64.4.240.3,64.4.240.4,64.4.240.5,64.4.240.6,64.4.240.7,64.4.240.8,64.4.240.9,64.4.240.10,64.4.240.11,64.4.240.12,64.4.240.13,64.4.240.14,64.4.240.15,64.4.240.16,64.4.240.17,64.4.240.18,64.4.240.19,64.4.240.20,118.214.15.186,118.215.103.186,118.215.119.186,118.215.127.186,118.215.15.186,118.215.151.186,118.215.159.186,118.215.167.186,118.215.199.186,118.215.207.186,118.215.215.186,118.215.231.186,118.215.255.186,118.215.39.186,118.215.63.186,118.215.7.186,118.215.79.186,118.215.87.186,118.215.95.186,202.43.63.186,69.192.31.186,72.247.111.186,88.221.43.186,92.122.143.186,92.123.151.186,92.123.159.186,92.123.163.186,92.123.167.186,92.123.179.186,92.123.183.186The Order ID received was: 670e029

That's the current content of the log, first there was only one entry.
I looked into the Orders and saw, that the last order with paypal was pending. The other orders before with paypal were confirmed.
So I just tried my own shop and buyed something with paypal.
On the frontend everything worked as it should and I got a mail from paypal, that I payed to my shop.
But on the backend I got the second entry in the log and my Order has also the status pending.

I've googeled this error and found a solution, that said, that I should change some code in backend... But to be honest, I would prefer to don't manually change the coding of virtuemart :/
https://www.rupostel.com/phpBB3/viewtopic.php?f=5&t=1070 (https://www.rupostel.com/phpBB3/viewtopic.php?f=5&t=1070)

It's quite confusing, because all the other orders before just worked normal...
I would be glad, If you could look into this.
Thank you!
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: jenkinhill on October 16, 2015, 12:10:01 pm
Your VirtueMart and Joomla versions are seriously out of date and are known to be insecure, so you should update. Current latest versions are VM3.0.11 and Joomla 3.4.4. Of course, test updates first on a backup of your site.  http://forum.virtuemart.net/index.php?topic=118683.0

The Paypal plugin has been updated several times since VM3.0.2 to work better.

Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: tantedante on October 17, 2015, 06:30:08 am
I've now updated to Joomla 3.4.4 and Virtuemart 3.0.10
I got no VM 3.0.11 as I downloaded the current version from the frontpage O.o

But the problem stays the same. I just tried it again and I get the same error in the logs and the status is pending, even tho I have payed with paypal.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on October 17, 2015, 10:39:35 am
Your problem is exactly as Stan (Rupostel) describes it... your working thru a proxy and have a comma separated list of ips instead of a single ip so the check fails

Error with REMOTE IP ADDRESS = 173.0.81.1, 10.19.1.100.

And Stans code will fix it

add it in \plugins\vmpayment\paypal\paypal\helpers\paypal.php

chked 3.0.10 and the code is the same as Stan describes - will fail on 2 or more ips - all it is doing is detecting the comma and checking the ip individually



Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: John2400 on January 12, 2016, 05:38:20 am
Hi I'm now getting this error as well.


Version virtuemart 3.0.12 Joomla 3.4.8 PHP 5.5


Had no issue ever  and have not changed anything as of 3 weeks.?


Any suggestions as  or should I go with GJC suggestion  from October.


yes an odd sale changes the status or is accepted and moves from pending to confirmed. my logs .. look almost the same as [/size]tantedante's
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on January 12, 2016, 09:41:07 am
so definitely the error shows that your ip is a comma separated list?

e.g.  Error with REMOTE IP ADDRESS = 173.0.81.1, 10.19.1.100.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: John2400 on January 12, 2016, 12:28:45 pm
Yes a long list of ip addresses separated by commas.


Exactly like the initial post. Below.


All associated with PayPal..



Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on January 12, 2016, 13:19:51 pm
I mean the 1st line of the error
Error with REMOTE IP ADDRESS = 173.0.81.1, 10.19.1.100.

I have never seen more than 2.. post the full error
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: John2400 on January 12, 2016, 22:20:45 pm
OK, I see what you mean in regards to two IPs. with commas
 But I'm getting repeated IPs rejected and not triggering the status from pending to confirmed.

I personally know some of these clients so they are not ....fake.

#
#<?php die("Forbidden."); ?>

2016-01-03 21:47:47 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 72.14.199.160.
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address

            These are the valid IP Addresses: 64.4.249.19,173.0.81.1,173.0.81.33,216.113.2016-01-04 02:37:00


ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 101.184.213.80.
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address

            These are the valid IP Addresses: .123.183.186 ...............The Order ID received was: 3DQ30162


2016-01-12 03:25:59

ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 208.115.113.83.
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address

            These are the valid IP Addresses: 23.198.113.104,173.02016-01-12 09:17:11

ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 49.199.19.28.
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address

            These are the valid IP Addresses: 104.114.161.73,173.0.81.33,173.0.81.1,216.113.188.202,216.113.188.203,216.113.188.204,66.211.170.66,173.0.88.66,173.0.88.98,173.0.84.66,173.0.84.98,173.0.80.00,173
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on January 12, 2016, 23:28:05 pm
but in this case the ip 72.14.199.160 is Google

NetRange:       72.14.192.0 - 72.14.255.255
CIDR:           72.14.192.0/18
NetName:        GOOGLE
NetHandle:      NET-72-14-192-0-1
Parent:         NET72 (NET-72-0-0-0-0)
NetType:        Direct Allocation
OriginAS:       
Organization:   Google Inc. (GOGL)
RegDate:        2004-11-10
Updated:        2012-02-24
Ref:            http://whois.arin.net/rest/net/NET-72-14-192-0-1
OrgName:        Google Inc.

the 101.184.213.80 is Aussie but not Paypal

inetnum:        101.160.0.0 - 101.191.255.255
netname:        TELSTRAINTERNET50-AU
descr:          Telstra
descr:          Level 12, 242 Exhibition St
descr:          Melbourne
descr:          VIC  3000
country:        AU

so are the other two

the whole idea is that the IPN post to you should only come from a paypal ip address

e.g.  64.4.249.19


NetRange:       64.4.240.0 - 64.4.251.255
CIDR:           64.4.240.0/21, 64.4.248.0/22
NetName:        PAYPAL-SITE
NetHandle:      NET-64-4-240-0-1
Parent:         NET64 (NET-64-0-0-0-0)
NetType:        Direct Assignment
OriginAS:       AS17012
Organization:   PayPal, Inc. (PAYPAL)
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: John2400 on January 13, 2016, 01:34:43 am
Ok,
So what does that mean.


And why? Are they using a mobile phone and the ip is picked up from it? 


 And is it a customer problem not VM, Joomla, or the server ..




Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on January 13, 2016, 12:59:54 pm
it is nothing to do with the users
the snippet is checking the ip address from where the PAYPAL IPN POST is coming from..
it has to come from PAYPAL otherwise it is not kosher!

this is nothing to do with the client

I have seen other e.g. confirmation posts from e.g. 3rd party payment gateways being somehow indexed by Google ( normally by Google tracking etc) and resubmitted later ..
i.e. "tested" by Google to check if it is a valid url ..

The payment plugin must be coded to ignore/dump these .. but have never seen Paypal IPN's re-submitted except by potential fraudsters
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: John2400 on January 13, 2016, 13:21:28 pm
Thanks,

I'll leave it as 95% look good to me at the moment.  I'll just keep an eye on it as it is new.
Most do the right thing.

again thanks
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: encreplus on January 15, 2016, 14:56:56 pm
Same problem here ...

ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 199.27.133.126.

VM 3.0.10
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on January 15, 2016, 22:06:54 pm
Is it a problem?  .. it has stopped one of your orders as being confirmed from an IP that isn't Paypal.. 

BTW it is a Cloudflare ip

NetRange:       199.27.128.0 - 199.27.135.255
CIDR:           199.27.128.0/21
NetName:        CLOUDFLARENET
NetHandle:      NET-199-27-128-0-1
Parent:         NET199 (NET-199-0-0-0-0)
NetType:        Direct Assignment
OriginAS:       AS13335
Organization:   CloudFlare, Inc. (CLOUD14)

If it was a proxy I think there should be a string of ips rejected...
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Milbo on January 19, 2016, 13:07:57 pm
chked 3.0.10 and the code is the same as Stan describes - will fail on 2 or more ips - all it is doing is detecting the comma and checking the ip individually

As far as I know this is fixed in vm3.0.12
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: rjcroasdale on January 25, 2016, 15:36:04 pm
hello :)
stAns fix doesnt seem to work for me, switchd out the checkIP function in helper with stAns but still problem. Also switch out with 3.0.12's version, sorry didn't upgrade the whole thing yet ;)

I get ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = .

.?  :o

Does any of you knows what will fix this problem so I can fix whilst waiting for maintenance session VM to 3.0.12 please?

thank you  :D 8)
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on January 25, 2016, 16:24:47 pm
is the error listing an ip address or a comma separated list of?
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: rjcroasdale on January 25, 2016, 17:57:05 pm
Hi GJC, the error is with a .

"checkPaypalIps: Error with REMOTE IP ADDRESS = ."
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on January 25, 2016, 19:37:42 pm
and are orders not confirming or is this just a random error?
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: rjcroasdale on January 26, 2016, 05:14:09 am
yes, along with this error, that's the problem, the orders stay pending...
...and after each paypal order / payment the "error with payment method" email is sent to me and vendor.

Code: [Select]
2016-01-26 06:06:57 DEBUG checkPaypalIps REMOTE ADDRESS:
2016-01-26 06:06:57 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = .
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address

also finding this php warning in httpd error log with paypal referer
Code: [Select]
PHP Warning:  syntax error, unexpected $end, expecting TC_DOLLAR_CURLY or TC_QUOTED_STRING or '"' in vmsafe/keys/id.ini on line 8 in /administrator/components/com_virtuemart/helpers/vmcrypt.php on line 102, referer: https://www.paypal.com/cgi-bin/webscr?cmd=_flow&SESSION=XHe6blahblah
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: rjcroasdale on January 30, 2016, 08:20:28 am
Hello peeps :)

gethostbynamel returns an array, individually checking www.paypal.com I get "Akamai International" but checking notify.paypal.com I do get a valid IP from the list... I'm still stuck up in here

Code: [Select]
php > echo gethostbyname('www.paypal.com');
104.83.1.168

php > echo gethostbyname('notify.paypal.com');
173.0.81.1

I have checked and compared code from my site and 3.0.12 but cant find anything related that may have been changed. I am now going to look for a change log, if I fail to find one.... is there a change log somewhere you could point me to please?

I found this Topic: Please test our new vm3.0.11.2 http://forum.virtuemart.net/index.php?topic=131898.0 Which I think is what I'm looking for, but cant find mention of Paypal CheckIPs update here - Anyone point me right please?

Thank you for reading bros  :D
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Milbo on February 04, 2016, 20:33:54 pm
Do use a reverse proxy?
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: rjcroasdale on February 08, 2016, 06:41:44 am
lu! thanks milbo :) I dont use a reverse proxy, I assumed it was Paypal using service to help servers, like cloudflare dos protection etc. Anyway - I stepped over that by adding manually IP address in the list for www.paypal.com to hosts to test. Still the same problem although now is resolving both www. and notify. to IP's that are in the list

Code: [Select]
php > echo gethostbyname('www.paypal.com');
173.0.88.66
php > echo gethostbyname('notify.paypal.com');
173.0.81.1

still getting error, thunk that would have at least patched my issue for now but seems something else

Code: [Select]
2016-02-08 05:24:41 DEBUG checkPaypalIps REMOTE ADDRESS:
2016-02-08 05:24:41 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = .
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address

            These are the valid IP Addresses: 173.0.88.66,173.0.81.33,173.0.81.1,216.113.188.202,216.113.188.203,216.113.188.204,66.211.170.66,173.0.88.66,173.0.88.98,173.0.84.66,173.0.84.98,173.0.80.00,173.0.80.01,173.0.80.02,173.0.80.03,173.0.80.04,173.0.80.05,173.0.80.06,173.0.80.07,173.0.80.08,173.0.80.09,173.0.80.10,173.0.80.11,173.0.80.12,173.0.80.13,173.0.80.14,173.0.80.15,173.0.80.16,173.0.80.17,173.0.80.18,173.0.80.19,173.0.80.20,173.0.82.126,173.0.88.67,173.0.88.99,173.0.84.99,173.0.84.67,173.0.88.69,173.0.88.101,173.0.84.69,173.0.84.101,173.0.88.68,173.0.88.100,173.0.84.68,173.0.84.100,173.0.81.1,173.0.81.33,64.4.240.0,64.4.240.1,64.4.240.2,64.4.240.3,64.4.240.4,64.4.240.5,64.4.240.6,64.4.240.7,64.4.240.8,64.4.240.9,64.4.240.10,64.4.240.11,64.4.240.12,64.4.240.13,64.4.240.14,64.4.240.15,64.4.240.16,64.4.240.17,64.4.240.18,64.4.240.19,64.4.240.20,118.214.15.186,118.215.103.186,118.215.119.186,118.215.127.186,118.215.15.186,118.215.151.186,118.215.159.186,118.215.167.186,118.215.199.186,118.215.207.186,118.215.215.186,118.215.231.186,118.215.255.186,118.215.39.186,118.215.63.186,118.215.7.186,118.215.79.186,118.215.87.186,118.215.95.186,202.43.63.186,69.192.31.186,72.247.111.186,88.221.43.186,92.122.143.186,92.123.151.186,92.123.159.186,92.123.163.186,92.123.167.186,92.123.179.186,92.123.183.186The Order ID received was:
         
I really might just see if I can bypass this function, you think I could do that? So the orders will get set to confirmed somewhere? ... pending orders, with no email to customer or vendor is starting to become a issue :( :D

Thank you for reading
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: rjcroasdale on March 04, 2016, 07:37:11 am
Hello there peeps :)

I am not sure what this was in the end, after upgrading PHP and Apache the problem went away. Thank you.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Milbo on March 04, 2016, 16:30:49 pm
Interesting, which php and apache did you use?
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: h20melon on April 14, 2016, 09:06:28 am
I was running version 3.0.14 and was getting this error.  Have just upgraded to 3.0.16 and still the same error message:

2016-04-14 06:54:19 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 173.0.81.1.
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address

            These are the valid IP Addresses: The Order ID received was: 1Y6P050

It doesn't specify the valid IP Addresses in the log file.

I did a ping on 173.0.81.1 and I get no response.

Any suggestions?

Thanks
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on April 14, 2016, 09:39:04 am
it is Paypal

NetRange:       173.0.80.0 - 173.0.95.255
CIDR:           173.0.80.0/20
NetName:        PAYPAL-SITE
NetHandle:      NET-173-0-80-0-1
Parent:         NET173 (NET-173-0-0-0-0)
NetType:        Direct Assignment
OriginAS:       AS17012
Organization:   PayPal, Inc. (PAYPAL)

but the line->

These are the valid IP Addresses:

should say

These are the valid IP Addresses: 104.108.64.175,173.0.81.33,173.0.81.1,216.113.188.202,216.113.188.203,216.113.188.204,66.211.170.66,173.0.88.66,173.0.88.98,173.0.84.66,173.0.84.98,173.0.80.00,173.0.80.01,173.0.80.02,173.0.80.03,173.0.80.04,173.0.80.05,173.0.80.06,173.0.80.07,173.0.80.08,173.0.80.09,173.0.80.10,173.0.80.11,173.0.80.12,173.0.80.13,173.0.80.14,173.0.80.15,173.0.80.16,173.0.80.17,173.0.80.18,173.0.80.19,173.0.80.20,173.0.82.126,173.0.88.67,173.0.88.99,173.0.84.99,173.0.84.67,173.0.88.69,173.0.88.101,173.0.84.69,173.0.84.101,173.0.88.68,173.0.88.100,173.0.84.68,173.0.84.100,173.0.81.1,173.0.81.33,64.4.240.0,64.4.240.1,64.4.240.2,64.4.240.3,64.4.240.4,64.4.240.5,64.4.240.6,64.4.240.7,64.4.240.8,64.4.240.9,64.4.240.10,64.4.240.11,64.4.240.12,64.4.240.13,64.4.240.14,64.4.240.15,64.4.240.16,64.4.240.17,64.4.240.18,64.4.240.19,64.4.240.20,118.214.15.186,118.215.103.186,118.215.119.186,118.215.127.186,118.215.15.186,118.215.151.186,118.215.159.186,118.215.167.186,118.215.199.186,118.215.207.186,118.215.215.186,118.215.231.186,118.215.255.186,118.215.39.186,118.215.63.186,118.215.7.186,118.215.79.186,118.215.87.186,118.215.95.186,202.43.63.186,69.192.31.186,72.247.111.186,88.221.43.186,92.122.143.186,92.123.151.186,92.123.159.186,92.123.163.186,92.123.167.186,92.123.179.186,92.123.183.186

from plugins\vmpayment\paypal\paypal\helpers\paypal.php  ~ line 533

var $paypal_iplist
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: h20melon on April 14, 2016, 10:09:45 am
Thanks for the reply GJC Web Design.

I have looked at that file and have attached it.  The IP address is in the file, as with lots of other IP addresses.  But I'm not sure what I'm looking at to fix it. 

It's strange that without changing anything, it stopped working and I hoped the update would have fixed it but didn't (guess it didn't update that file).

Thanks

Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on April 14, 2016, 13:16:45 pm
have just completed a J3.5.1/VM3.0.16 and Paypal for me is working fine

you need to set up a1 cent test product and get testing.. no one else is reporting a problem.. so u need to debug this
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: h20melon on April 15, 2016, 01:19:19 am
Fixed by renaming plugins/vmpayment/paypal folder and reinstalling AIO.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: FabioZumbi12 on August 24, 2016, 05:20:13 am
Hello,

Now i having this same problem!
The error on log is this:
Code: [Select]
2016-08-23 13:37:50 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 199.27.133.238.
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address

            These are the valid IP Addresses: 23.209.71.234,173.0.81.33,173.0.81.1,216.113.188.202,216.113.188.203,216.113.188.204,66.211.170.66,173.0.88.66,173.0.88.98,173.0.84.66,173.0.84.98,173.0.80.00,173.0.80.01,173.0.80.02,173.0.80.03,173.0.80.04,173.0.80.05,173.0.80.06,173.0.80.07,173.0.80.08,173.0.80.09,173.0.80.10,173.0.80.11,173.0.80.12,173.0.80.13,173.0.80.14,173.0.80.15,173.0.80.16,173.0.80.17,173.0.80.18,173.0.80.19,173.0.80.20,173.0.82.126,173.0.88.67,173.0.88.99,173.0.84.99,173.0.84.67,173.0.88.69,173.0.88.101,173.0.84.69,173.0.84.101,173.0.88.68,173.0.88.100,173.0.84.68,173.0.84.100,173.0.81.1,173.0.81.33,64.4.240.0,64.4.240.1,64.4.240.2,64.4.240.3,64.4.240.4,64.4.240.5,64.4.240.6,64.4.240.7,64.4.240.8,64.4.240.9,64.4.240.10,64.4.240.11,64.4.240.12,64.4.240.13,64.4.240.14,64.4.240.15,64.4.240.16,64.4.240.17,64.4.240.18,64.4.240.19,64.4.240.20,118.214.15.186,118.215.103.186,118.215.119.186,118.215.127.186,118.215.15.186,118.215.151.186,118.215.159.186,118.215.167.186,118.215.199.186,118.215.207.186,118.215.215.186,118.215.231.186,118.215.255.186,118.215.39.186,118.215.63.186,118.215.7.186,118.215.79.186,118.215.87.186,118.215.95.186,202.43.63.186,69.192.31.186,72.247.111.186,88.221.43.186,92.122.143.186,92.123.151.186,92.123.159.186,92.123.163.186,92.123.167.186,92.123.179.186,92.123.183.186The Order ID received was: AM1I042
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on August 24, 2016, 10:18:56 am
199.27.133.238  is a Cloudflare address if this helps?

Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: ironbone on August 01, 2019, 23:12:12 pm
I have got tiday the same problem when creating refund from PayPal
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Jörgen on August 02, 2019, 00:19:25 am
Using what paypal version ? Core or eternal plugin ?
Using what VM version eactly ? Latest does not cut it ...
Using what Joomla version ? Latest does not cut it ...
Using proxy server ?
You have what error messages ?

Jörgen @ Kreativ Fotografi
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Marttyn on October 15, 2019, 11:25:24 am
Im having the same problem here.
I was using VM 3.4.2 and J3.9.8 and i received an email letting me know about a paypal payment problem
Updated to VM 3.6.0, and still get the same problem.

Only some of the payments generate an error. The payment is processed, but the order is left in pending status.
In two days maybe i received 10 payments, but only 3 gave error.

Im behind Cloudflare (free) service to provide SSL and CDN to my website. May this cause the problem?
Truth is that ive been using VM and Paypal payments for 5 years, and never had a problem with it.

This is the log:
Code: [Select]
2019-10-14 07:24:54 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 66.211.170.66.

                        The remote address of the script posting to this notify script does not match a valid PayPal IP address


            These are the valid IP Addresses: 173.0.84.8,173.0.84.40,173.0.88.8,173.0.88.40,173.0.81.1,173.0.81.33The Order ID received was: 2D610894
2019-10-15 06:46:29 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 66.211.170.66.

                        The remote address of the script posting to this notify script does not match a valid PayPal IP address


            These are the valid IP Addresses: 173.0.84.40,173.0.88.8,173.0.88.40,66.211.169.17,173.0.84.8,173.0.81.33,173.0.81.1The Order ID received was: 7EZB0902
2019-10-15 08:44:21 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 66.211.170.66.

                        The remote address of the script posting to this notify script does not match a valid PayPal IP address


            These are the valid IP Addresses: 173.0.88.40,66.211.169.17,173.0.84.8,173.0.84.40,173.0.88.8,173.0.81.33,173.0.81.1The Order ID received was: MJBG0903

Right now im simply confirming the orders manually... but i hope to solve this soon, im on a preorder campaign and this is making it more difficult.

By the way... Its curious that any correct Paypal payment generates an email from Paypal to me and to user, and also Paypal App generates a notification on my phone. But a error payment is not generating any email or notification, even if the payment has been processed (i have the funds, and user has been deducted). If its a VM plugin problem, why paypal dont generates the notifications anyway?

Regards!
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Jörgen on October 15, 2019, 11:39:54 am
The PayPal payment method gives control to PayPal website. If PayPal does not give any correct return data then it does not know if it has gone wrong. An aborted PayPal transaction (closed browser) is a no event and does not generate a call back the Paypal payment plugin. If the IP check is active and a firewall or similar changes the IP to anything but the official PayPal IP adresses you will get an error and Paypal continues to send messages until Your PayPal plugin accepts these messages.

Turn off IP check in the PayPal plugin, else you have to make the correct IP from PayPal come through.

Jörgen @ Kreativ Fotografi
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Marttyn on October 15, 2019, 13:00:51 pm
Ok, IP check disabled...
But what can be causing the IP problem? And why now?
Cloudflare DNS could be the issue? Never had problem with this until yesterday.
I guess that it would be better to have the IP check enabled if possible
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Jörgen on October 15, 2019, 13:15:26 pm
Yes IP check gives an extra layer of security. The cloudfare DNS could give You the IP-address: 66.211.170.66

Jörgen @ Kreativ Fotografi
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Studio 42 on October 15, 2019, 14:01:37 pm
66.211.170.66 is notify.paypal.com
You can check here https://dnschecker.org/ip-to-hostname.php (https://dnschecker.org/ip-to-hostname.php)
The plugin need to be updated; i have now 3 customers reported me this IP now because no notification was send.
I can see in logfile for eg.
2019-10-15 05:54:54 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 66.211.170.66.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on October 15, 2019, 15:07:35 pm
the ips are collected dynamically in the plugin .. it appears because of "something" that there has been a delay in finding them by  $paypal_iplist_notify = gethostbynamel('notify.paypal.com');

but seems to be working now
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Fantastic4 on October 15, 2019, 18:04:55 pm
Hello,
since last Friday we have the same problem with our Virtuemart Shop, based on Joomla 3.9.12, Virtuemart 3.6.2, Rupostel 2.0.394, Plugin VM-Payment Paypal 3.6.2
All errors in Logfile paypal.2.log.php are showing the following message

ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 66.211.170.66.

But not all PayPal transaction fail, we also have PayPal Transactions which get completed.
This Transactions have used other Remote Address 173.0.81.1 to check PaypalIPs.

The last PayPal error was at 16:44 German Time.
So it seems not to be solved, yet.

Will there be an update of the PayPal-Plugin the next days.
If not, I'm glad for any advice or help.
Thank you
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Marttyn on October 15, 2019, 18:12:02 pm
Yes, for me most of the orders are completed correctly, some of them have error. I turned off the IP checking until its solved
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: AH on October 15, 2019, 18:41:48 pm
Someone try talking to PayPal

This should work and has worked up until Friday - there may be an update to VM but that is a sticking plaster of PayPal's failures!!
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: lostmail on October 15, 2019, 20:52:46 pm
..same trouble:

User`s IP (in the order):
84.145.246.xx

Error Message in paypal.2.log.phppaypal.2.log.php:

Quote
2019-10-15 16:41:41 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 66.211.170.66.
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address

            These are the valid IP Addresses: 173.0.84.8,173.0.88.8,173.0.88.40,66.211.169.17,173.0.84.40,173.0.81.33,173.0.81.1The Order ID received was: F1HR02005

30 Minutes before I have another paypal order which passed completely through.

I deactivated the Check IPN provider IP funktion...hope that works but it is not realy a solution...
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Jörgen on October 15, 2019, 23:29:29 pm
The problem seems to be that PayPals server does not always return a complete list of valid IP. As Patrick pointed out, 66.211.170.66 is actually a valid PayPal IP. But for some reason the call to Paypal does not work flawlessly, so this IP is not included. This does not seem to be a Virtuemart issue, it looks more like PayPal has irratic problems with their data communication.

Jörgen @ Kreativ Fotografi
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Milbo on October 16, 2019, 13:29:50 pm
The new version allows to manually add extra IPs (comma seperated). So when something happens like on friday, you can add the ip temporarly yourself http://dev.virtuemart.net/attachments/1204/com_virtuemart.3.6.3.10179_package_or_extract.zip
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: gba on October 17, 2019, 15:05:50 pm
Hi!

I am having the same problem.
What do you mean with "temporarly"?
Until when?

Kind regards,
Gerald
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Jörgen on October 17, 2019, 15:27:04 pm
This You should ask PayPal, they can probably say when their server works as expected again.

Jörgen @ Kreativ Fotografi
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: gba on October 17, 2019, 17:33:45 pm
Interesting:
Here the IP address 66.211.170.66 is listed:
https://www.paypal.com/nu/smarthelp/article/what-are-the-ip-addresses-for-live-paypal-servers-ts1056 (https://www.paypal.com/nu/smarthelp/article/what-are-the-ip-addresses-for-live-paypal-servers-ts1056)
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: AH on October 17, 2019, 19:00:34 pm
It makes no difference what they list - PayPal are not returning that data when asked for a list of valid IPs

When asked for them using:

            $paypal_iplist_ipnpb       = gethostbynamel('ipnpb.paypal.com');
            $paypal_iplist_notify      = gethostbynamel('notify.paypal.com');



Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: gba on October 17, 2019, 19:03:59 pm
I know.

I posted the problem here:
https://www.paypal-community.com/t5/REST-APIs/Why-PHP-function-gethostbynamel-does-not-deliver-all-PayPal-IPs/td-p/1933625 (https://www.paypal-community.com/t5/REST-APIs/Why-PHP-function-gethostbynamel-does-not-deliver-all-PayPal-IPs/td-p/1933625)
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Studio 42 on October 17, 2019, 20:59:05 pm
1 server can have multiple IP's so using gethostbynamel only return 1 IP and not all valids IP
the plugin should use gethostbyaddr('MY.IP.ADDR');
and compare if this end with .paypal.com or perhaps simply if this is notification.paypal.com
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Jörgen on October 17, 2019, 21:26:28 pm
Sorry Patrick, have to disagree:
Php documentation:
Quote
(PHP 4, PHP 5, PHP 7)

gethostbynamel — Get a list of IPv4 addresses corresponding to a given Internet host name
https://www.php.net/manual/en/function.gethostbynamel.php (https://www.php.net/manual/en/function.gethostbynamel.php)

This seems not be working as expected, sometimes, at PayPal servers.

Jörgen @ Kreativ Fotografi
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: gba on October 19, 2019, 18:44:05 pm
The new version allows to manually add extra IPs (comma seperated). So when something happens like on friday, you can add the ip temporarly yourself http://dev.virtuemart.net/attachments/1204/com_virtuemart.3.6.3.10179_package_or_extract.zip

Please DO NOT install this version!!!
It has a problem with the config setting 'Enable legacy layouts'.
From version 3.6.3.10180 this problem has been fixed.

Kind regards,
Gerald
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Fantastic4 on October 19, 2019, 20:15:25 pm
When will be released this new version 3.6.310180?
I' ve installed VM 3.6.3.10179 yesterday, because of PayPal IP errors and now I have errors with Menu Items in category layout.
When ever I open pages in category layout, it shows the following error in frontend:
Fehlermeldung 0 - Call to a member function getPagesLinks() on string
Before updating to VM 3.6.310179 everythink worked well.

The Installation is based on Virtuemart 3.6.3 10179, Joomla 3.9.12, Rupostel OPC 2.0.394.141019
Server: Apache, Debian Linux, PHP 7.2.23, MySQL 5.7.27.-1

My Logfile "everything.php" shows the following entries on error:
 
2019-10-18T15:55:11+00:00   WARNING IP-Address   assets   No asset found for com_content.category.root, falling back to com_content
2019-10-18T15:55:11+00:00   CRITICAL IP-Address   error   Uncaught \Throwable of type JException thrown. Stack trace: #0 /usr/www/users/username/webseiten/parent-directory/joomla-root/libraries/legacy/error/error.php(277): JError::raise(1, 404, 'Kategorie nicht...', NULL, true)
#1 /usr/www/users/username/webseiten/parent-directory/joomla-root/libraries/src/MVC/View/CategoryView.php(133): JError::raiseError(404, 'Kategorie nicht...')
#2 /usr/www/users/username/webseiten/parent-directory/joomla-root/components/com_content/views/category/view.html.php(75): Joomla\CMS\MVC\View\CategoryView->commonCategoryDisplay()
#3 /usr/www/users/username/webseiten/parent-directory/joomla-root/libraries/src/MVC/Controller/BaseController.php(672): ContentViewCategory->display()
#4 /usr/www/users/username/webseiten/parent-directory/joomla-root/components/com_content/controller.php(118): Joomla\CMS\MVC\Controller\BaseController->display(true, Array)
#5 /usr/www/users/username/webseiten/parent-directory/joomla-root/libraries/src/MVC/Controller/BaseController.php(710): ContentController->display()
#6 /usr/www/users/username/webseiten/parent-directory/joomla-root/components/com_content/content.php(43): Joomla\CMS\MVC\Controller\BaseController->execute('')
#7 /usr/www/users/username/webseiten/parent-directory/joomla-root/libraries/src/Component/ComponentHelper.php(402): require_once('/usr/www/users/...')
#8 /usr/www/users/username/webseiten/parent-directory/joomla-root/libraries/src/Component/ComponentHelper.php(377): Joomla\CMS\Component\ComponentHelper::executeComponent('/usr/www/users/...')
#9 /usr/www/users/username/webseiten/parent-directory/joomla-root/libraries/src/Application/SiteApplication.php(194): Joomla\CMS\Component\ComponentHelper::renderComponent('com_content')
#10 /usr/www/users/username/webseiten/parent-directory/joomla-root/libraries/src/Application/SiteApplication.php(233): Joomla\CMS\Application\SiteApplication->dispatch()
#11 /usr/www/users/username/webseiten/parent-directory/joomla-root/libraries/src/Application/CMSApplication.php(196): Joomla\CMS\Application\SiteApplication->doExecute()
#12 /usr/www/users/username/webseiten/parent-directory/joomla-root/index.php(49): Joomla\CMS\Application\CMSApplication->execute()
#13 {main}

Kind regards
Michael
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Fantastic4 on October 19, 2019, 21:03:33 pm
My problem ist solved now. Thank you for supporting me. Especially to gba.
After a lot of searching in this forum, the post of gba was the final help to find the right solution.
When I've disabled the option "Enable legacy layouts" in Virtuemart configuration, everything is fine again and all pages in category layout are restored.
Best regards
Michael
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: AH on October 21, 2019, 11:22:07 am
patrick

I have to disagree also

gethostbyname returns an array of ip addresses and this has been implemented and functional for a long time in the PayPal plugin.

the plugin should use gethostbyaddr('MY.IP.ADDR')

Means you go back to storing a whole heap of IPs - which is not sustainable and a step back and away from paypal's URL address suggestion

Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Studio 42 on October 21, 2019, 22:50:07 pm
OK, but currently the IP list is bad. So if you invert the logic, you have more chance to get the right result.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: AH on October 22, 2019, 10:30:28 am
Inverting the logic??

VM uses the function and system that PayPal propose. 

Fixed IP or other options should be configurable by customers wishing to "override/enhance" such functionality.

This is provided - in that you can turn off IP checking for IPN messages (until someone at PayPal pulls there proveriabe finger out of their ass and sorts this issue)

Additionally in the latest PayPal plugin - you can add a whitelist of IP addresses by configuration.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Pitpan on October 24, 2019, 09:23:01 am
Currently i have the same error with some of the orders completed with paypal.

Code: [Select]
2019-10-23 18:53:07 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 66.211.170.66.
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address

            These are the valid IP Addresses: 173.0.88.8,173.0.84.8,173.0.84.40,173.0.88.40,66.211.169.17,173.0.81.1,173.0.81.33The Order ID received was:

The payment completed but the order remain as "pending"
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Jörgen on October 24, 2019, 10:44:07 am
As You may have read in this thread.

The call to the PayPal server does not return all of the valid IP adresses.

There is a band aid supplied by the VM team in VM ver 3.6.3.10180 that allows the VM admin to include valid IP directly in the PayPal plugin. This is a solution that works in the case that PayPal does not give the correct IP adresses. This is not the ultimate solution, but as long as PayPal does not change these valid IP, it will work.

If You can not use the VM 3.6.3.10180, You have to manually confirm the order that get pending.

Jörgen @ Kreativ Fotografi
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: AH on October 24, 2019, 11:09:35 am
And contact your PayPal representative to complain

It is a PayPal fault - Vm is trying to use what PayPal recommends for validating IPN ip addresses.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: user_fra on October 25, 2019, 10:35:32 am
Hi,
(Joomla! 3.9.12  VirtueMart 3.6.2 10159)
same problem with 5 orders. Some orders are ok, some others gave this kind of error, from log file: 2019-10-24 15:57:17 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 66.211.170.66.
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address

            These are the valid IP Addresses: 173.0.84.40,66.211.169.17,173.0.88.8,173.0.84.8,173.0.88.40,173.0.81.1,173.0.81.33The Order ID received was: Ordine nr. 418-2019-T

Could you please tell me where I can manually add the IP 66.211.170.66. in PayPal plugin configuration? I was not able to identify the correct field.

Thank you, best regards.
Francesco
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on October 25, 2019, 10:48:11 am
Quote
VM ver 3.6.3.10180 that allows the VM admin to include valid IP directly in the PayPal plugin

find here  http://dev.virtuemart.net/attachments/1205/com_virtuemart.3.6.3.10184_package_or_extract.zip

if u don't want to upgrade then download this version, extract the paypal plugin from the archive and install
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: StefanSTS on October 25, 2019, 12:11:36 pm
You could add the IP manually in VM 3.4.2 until you can update.

plugins/vmpayment/paypal/paypal/helpers/paypal.php
Find this code and add the part below //STS

Code: [Select]
//      XXX See below from AH


Nicer version all in one from AH would be:
Code: [Select]
// Get IP through DNS call
// Reporting and order management
$paypal_iplist_ipnpb = gethostbynamel('ipnpb.paypal.com');
$paypal_iplist_notify = gethostbynamel('notify.paypal.com');
$extraIps = array('66.211.170.66');

$paypal_iplist = array_merge( // JH 2017-04-23
// List of Reporting and order management
$paypal_iplist_ipnpb,
$paypal_iplist_notify,
$extraIps
);
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: user_fra on October 25, 2019, 15:55:21 pm
Thanks for your gentle and fast support!

In VM Paypal configuration I desabled the option Check IPN provider IP. I think it will solve the problem. I suppose it is a security option, but for every order I receive an e-mail from VM and another e-mail from Paypal, so, if in a future order I do not receive the e-mail sent by Paypal I will investigate immediately.

Thanks a lot.
Francesco 
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: AH on October 25, 2019, 16:40:49 pm
Agreed - if you are not comfortable making the code change and can wait for the next release of VM - disabling IPN IP checking and validating via emails should work for you.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Studio 42 on October 26, 2019, 13:00:28 pm
Here is how i think it should be done with my reverted logic.
Code: [Select]
        $remoteIPAddress=$this->getRemoteIPAddress();
        $hostname = gethostbyaddr($remoteIPAddress);
        if ($this->_method->sandbox) {
         $paypalHosts = array('ipn.sandbox.paypal.com','ipnpb.sandbox.paypal.com');
      else {
         $paypalHosts = array('ipnpb.paypal.com','notify.paypal.com');
      }
      if (!in_array($hostname, $paypalHosts)) {
         // paypal IP not valid
         return false;
         
      }

I hope you understand better the advantage of this solution ?
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Studio 42 on October 26, 2019, 13:20:00 pm
I have done a little test and it seems that paypal IP send from gethostbynamel change some time
See https://pro.st42.fr/demo/paypal.php (https://pro.st42.fr/demo/paypal.php)
So the solution is perhaps to mix the 2 codes because in some case the returned domaine is the IP itself !
This is the last list generated by my code :
Quote
IP : 66.211.169.17 HOST : ipnpb.paypal.com
IP : 173.0.88.40 HOST : ipnpb.paypal.com
IP : 173.0.84.8 HOST : ipnpb.paypal.com
IP : 173.0.88.8 HOST : ipnpb.paypal.com
IP : 173.0.84.40 HOST : 173.0.84.40
IP : 173.0.81.1 HOST : notify.paypal.com
IP : 173.0.81.33 HOST : notify.paypal.com
IP : 66.211.170.66 HOST : notify.paypal.com
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Studio 42 on October 26, 2019, 13:22:16 pm
Another test give another result
IP : 173.0.84.8 HOST : ipnpb.paypal.com
IP : 173.0.88.8 HOST : ipnpb.paypal.com
IP : 173.0.84.40 HOST : 173.0.84.40
IP : 173.0.88.40 HOST : ipnpb.paypal.com
IP : 66.211.169.17 HOST : ipnpb.paypal.com
IP : 173.0.81.1 HOST : notify.paypal.com
IP : 173.0.81.33 HOST : notify.paypal.com
IP : 66.211.170.66 HOST : notify.paypal.com
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Pitpan on October 26, 2019, 16:34:02 pm
I believe that uncheck IPN provider IP in Paypal payment method, it is the best solution as for now.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: GJC Web Design on October 26, 2019, 16:58:57 pm
Quote
I believe that uncheck IPN provider IP in Paypal payment method, it is the best solution as for now.

Accepting that it does lower your security.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: ssc3 on October 28, 2019, 10:18:13 am
I believe that uncheck IPN provider IP in Paypal payment method, it is the best solution as for now.

Even if you turn off IP checking, Virtuemart still performs other security checks.

It HTTPS posts the IPN message back to PayPal. PayPal then respond with either VERIFIED

if the message matches the original or INVALID if it does not. It shows if PayPal sent the IPN.

The openssl also checks the PayPal Secure Certificate to confirm you are connected to a

PayPal Secure Server.

Arguably better than checking the IP address. Certainly more reliable.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: AH on October 28, 2019, 16:53:34 pm
ssc3 - exactly

Other checks are still performed - even when no  IP checking is set
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: sean_nwfs on October 29, 2019, 17:49:42 pm
Struggling with the same issue. I spoke with Paypal and they sent this list: https://www.paypal.com/us/smarthelp/article/what-are-the-ip-addresses-for-live-paypal-servers-ts1056. Not sure if this might be useful to the devs.

I also appreciate the new feature in 3.6.4 for adding extra IPs for IPN Check.

Joomla 3.9.12
VM 3.6.4.10187
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: StefanSTS on October 29, 2019, 18:08:38 pm
The first sentence in the link says what VirtueMart should do:
"When you make API calls, PayPal strongly recommends that you use Domain Name Service (DNS) results with the default Time To Live (TTL) values, to determine the IP addresses of our servers."

VirtueMart does that, and there is the issue with Paypal. Not all addresses are returned. That is why the IPN is rejected.

We will see how it goes on.

Thanks for your effort in communicating with Paypal. The more the merrier, someone the right support person might actually be able to help.

Regards
Stefan
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: sean_nwfs on October 29, 2019, 19:20:19 pm
Again, not sure if this is helpful but they wrote back.

"If plugin can do an nslookup against the IP address (not the host name), you'll see that it resolves to notify.paypal.com, and as such, can be trusted & know the IPN came from a valid PayPal IP."

Not sure if the plugin can do that or not.

Thanks!
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Jörgen on October 29, 2019, 21:04:51 pm
Again, not sure if this is helpful but they wrote back.

"If plugin can do an nslookup against the IP address (not the host name), you'll see that it resolves to notify.paypal.com, and as such, can be trusted & know the IPN came from a valid PayPal IP."

Not sure if the plugin can do that or not.

Thanks!


Looks like the solution studio42 suggested earlier.

Jörgen @ Kreativ Fotografi
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: ssc3 on October 30, 2019, 09:40:26 am
"If plugin can do an nslookup against the IP address (not the host name), you'll see that it resolves to notify.paypal.com, and as such, can be trusted & know the IPN came from a valid PayPal IP."


WorldPay also recommend using Reverse DNS lookup, it does not seem to cause the same problems PayPal is having with with lists of IP addresses.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Milbo on November 01, 2019, 11:30:56 am
So the solution is perhaps to mix the 2 codes because in some case the returned domaine is the IP itself !

Like that?
Code: [Select]
if ($this->_method->sandbox) {
$paypalHosts = array('ipn.sandbox.paypal.com','ipnpb.sandbox.paypal.com');
} else {
$paypalHosts = array('ipnpb.paypal.com','notify.paypal.com');
}

$paypal_iplist = array();
foreach($paypalHosts as $host){
$ipList = gethostbynamel($host);
$paypal_iplist = array_merge($paypal_iplist,$ipList);
}
if (isset($this->_method->extra_ips)){
$extraIps = explode(',',$this->_method->extra_ips);
$paypal_iplist = array_merge($paypal_iplist,$extraIps);
}

$this->debugLog($paypal_iplist, 'checkPaypalIps $paypal_iplist', 'debug', false);

$remoteIPAddress = ShopFunctions::getClientIP();
$hostname = gethostbyaddr($remoteIPAddress);
$this->debugLog($remoteIPAddress, 'checkPaypalIps REMOTE ADDRESS', 'debug', false);

//  test if the remote IP connected here is a valid IP address
if (!in_array($remoteIPAddress, $paypal_iplist) and !in_array($hostname, $paypalHosts)) {

$text = "Error with REMOTE IP ADDRESS = " . $remoteIPAddress . ".\n
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address\n
            These are the valid IP Addresses: " . implode(",", $paypal_iplist) . "The Order ID received was: " . $order_number;
$this->debugLog($text, 'checkPaypalIps', 'error', false);
return false;
}
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Studio 42 on November 04, 2019, 11:58:02 am
Yes,
i don't tested, but it's what i mean
So the solution is perhaps to mix the 2 codes because in some case the returned domaine is the IP itself !

Like that?
Code: [Select]
      if ($this->_method->sandbox) {
         $paypalHosts = array('ipn.sandbox.paypal.com','ipnpb.sandbox.paypal.com');
      } else {
         $paypalHosts = array('ipnpb.paypal.com','notify.paypal.com');
      }

      $paypal_iplist = array();
      foreach($paypalHosts as $host){
         $ipList = gethostbynamel($host);
         $paypal_iplist = array_merge($paypal_iplist,$ipList);
      }
      if (isset($this->_method->extra_ips)){
         $extraIps = explode(',',$this->_method->extra_ips);
         $paypal_iplist = array_merge($paypal_iplist,$extraIps);
      }

      $this->debugLog($paypal_iplist, 'checkPaypalIps $paypal_iplist', 'debug', false);

      $remoteIPAddress = ShopFunctions::getClientIP();
      $hostname = gethostbyaddr($remoteIPAddress);
      $this->debugLog($remoteIPAddress, 'checkPaypalIps REMOTE ADDRESS', 'debug', false);

      //  test if the remote IP connected here is a valid IP address
      if (!in_array($remoteIPAddress, $paypal_iplist) and !in_array($hostname, $paypalHosts)) {

         $text = "Error with REMOTE IP ADDRESS = " . $remoteIPAddress . ".\n
                        The remote address of the script posting to this notify script does not match a valid PayPal IP address\n
            These are the valid IP Addresses: " . implode(",", $paypal_iplist) . "The Order ID received was: " . $order_number;
         $this->debugLog($text, 'checkPaypalIps', 'error', false);
         return false;
      }
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: hegbi on November 04, 2019, 21:48:54 pm
tested, Revision 10195 works, thank you!!
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: pellegrinoL on October 23, 2020, 11:07:00 am
Hi,

I am using VirtueMart 3.4.3 10005 and Joomla! 3.8.13

since 3 days I am having this problem see:
These are the valid IP Addresses: 173.0.88.40,66.211.169.17,173.0.84.40,173.0.88.8,173.0.81.33,173.0.81.1The Order ID received was: Ordine-2020-2460
2020-10-20 09:22:50 ERROR checkPaypalIps: Error with REMOTE IP ADDRESS = 66.211.170.66.
The remote address of the script posting to this notify script does not match a valid PayPal IP address

Have I to contact PayPal to solve this issue or is temporary problem?

Best
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: AH on October 23, 2020, 11:10:40 am
Please search the forums for similar posts and resolutions

It could be your web host routing internal IPs
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: Studio 42 on October 26, 2020, 09:46:09 am
You can disable IP check in the plugin.
Title: Re: Paypal ERROR checkPaypalIps: Error with REMOTE IP ADDRESS
Post by: pellegrinoL on November 04, 2020, 10:44:20 am
Many thanks, I will try