Storing Credit Card Numbers in SESSION - ways around it?

后端 未结 13 2160
独厮守ぢ
独厮守ぢ 2021-01-30 05:11

I am well aware of PCI Compliance so don\'t need an earful about storing CC numbers (and especially CVV nums) within our company database during checkout process.

Howev

相关标签:
13条回答
  • 2021-01-30 06:11

    Is there any reason you can't skip the confirmation step and just submit the transaction immediately?

    I don't see why keeping it in a database is any more secure than keeping it in a session variable — server compromise will still give away the credit card number, but if you keep it in the session it's far less likely to be written to disk. You can encrypt it if you want, but the usefulness of this is dubious (it'll still be swapped to disk). Adding another machine to do encrypted storage doesn't help either, since the compromised machine can just ask the other one to do decrypting.

    EDIT: Just thought of this:

    1. Generate a random 128-bit key. Save this in the session.
    2. Encrypt the data with the key. Send it to the client in an <input type="hidden">
    3. On confirmation, decrypt the data and submit the transaction.

    An attacker needs to compromise both the client and the server to get the credit card number (such an attacker would probably have the number already anyway). An online server compromise will still get the credit card numbers of future transactions, but you can't really stop that.

    EDIT: And I forgot the details. For all of these schemes (not just mine), you also need a MAC to prevent replay attacks (or Eve distracts Alice, modifies the shopping basket and billing address, and hit the "confirm" page...). In general, you want to have a MAC on all the transaction data you have (CC, CVV, transaction ID, transaction amount, billing address...).

    0 讨论(0)
提交回复
热议问题