Reputation: 2185
I am currently integrating the NAB Transact payment gateway into a e-commerce shop. Once the payment has been processed the NAB Transact system sends a POST request to our endpoint for us to process the result.
The problem is that the POST request contains no secure hash / token that we can use to post back to the NAB Transact system to authenticate that the request is real and not spoofed. Even worse, the NAB Transact system does not even have a API for any authentication of any information, essentially, very bad security!
Is there a way to securely authenticate these requests? For example, checking that the requests come from a list of known IP addresses that the NAB transact system operates on? Or reverse lookup a IP? What options are there and how would you implement this in PHP?
Isn't relying on IP authentication not that secure since it can be spoofed?
Upvotes: 4
Views: 386
Reputation: 121881
The problem is that the POST request contains no secure hash / token that we can use to post back to the NAB Transact system to authenticate that the request is real and not spoofed
Yup - that's a problem alright :)
Isn't relying on IP authentication not that secure since it can be spoofed?
It isn't at ALL secure!
Upvotes: 0
Reputation: 318808
Authentication based on IP addresses is fine if you:
Spoofing the source IP is not possible since TCP uses a three-way-handshake and with a spoofed IP the handshake would fail.
So basically: Authentication by IP is acceptable if some basic criteria are met (see above), but of course it would be more secure if they provided you with a way to validate the notification - either by calling an API on their side or by using a cryptographic signature (better since it cannot fail due to an unreachable remote server).
Upvotes: 1