by exratione · 14y ago · 0 comments
I've supported a number of different online credit card donation forms for various charitable and other causes, and you see this behavior of card testing whenever you set the minimum allowed donation too low, and adopt too few of the necessary precautions.
I wrote a post on the approach to raising the bar I took - it really doesn't require much to get the credit card testers to go away, and if you don't get rid of them rapidly, you'll be dealing with chargebacks from here until eternity:
http://www.exratione.com/2010/10/three-necessary-defenses-fo...
Most small online businesses do not store credit card data locally, but that doesn't stop you from using salted hashes of credit card numbers to compare.
Storing a "salted hash" of a credit card number in the manner you describe is only fractionally better than storing the credit card number itself. This is because credit card numbers have very little entropy - less than 36 bits per issuer code, so bruteforcing these hashes can be done very quickly.
https://github.com/whit537/www.gittip.com/issues/345
Even then, I'm not sure I would trust this approach. I feel much more comfortable white-listing accounts, and for the time being that's not too onerous.
You could hash the IP address, with some suitable salt. Then compare against that.
The purpose of storing IP addresses isn't to find out "the IP address of the user submitting the form", but instead to answer "How many other credit card numbers have come from this address?", something that can be done with sha512("salt_mc_salty_$IP")
No, with IP logging it's all-or-nothing. You might as well store them as uint32/uint128.
I would also, advise against your plan to just white list givers. There are already too many barriers to contributing. I would suggest just charging and holding onto money when the transactions seem dubious. Do you also get charged the cost of fraud? because if you don't I would just charge the credit cards and forget about it and let your provider do their job.
Could you run them off by just always displaying success for any sane-looking small value donation, without leaking the result from your payment processor?
Alternately (or in addition to this), you could rate-limit form submissions from the same address.