Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent replay attacks? #344

Closed
ttmc opened this issue May 30, 2016 · 3 comments
Closed

Prevent replay attacks? #344

ttmc opened this issue May 30, 2016 · 3 comments
Assignees

Comments

@ttmc
Copy link
Contributor

ttmc commented May 30, 2016

If a man-in-the middle (MITM, an eavesdropper) records a transaction as it travels from a client to a node, it can re-send that transaction to the federation over and over again (even if it's encrypted). This is a so-called "replay attack." It doesn't require the MITM to have a valid private key.

Analysis

  • If the transaction is a transfer transaction, then only the first copy can spend the asset. The rest will look like double spending attempts and they won't validate.
  • If the transaction is a creation transaction, will each copy create a new asset? It seems to me that they'll all have the same id/hash (even if they're sent to different federation nodes). If a transaction with the id/hash is already in the backlog, a second one with the same id (primary key) can't be inserted. There's another issue When validating a transaction, check to ensure it isn't a duplicate #131 to check for duplicate transactions in the bigchain table (as part of tx validation).

Please keep this issue open as something to re-check from time to time, at least for now (while things are still changing).

@ttmc
Copy link
Contributor Author

ttmc commented May 30, 2016

Note: A common solution to prevent replay attacks is to add a "sequence number" to each transaction from a given public key. The sequence number must increase by 1 with each transaction from that public key. Checking the sequence number becomes part of transaction validation.

While a sequence number doesn't seem necessary to prevent replay attacks (see above), it may be used as a way to prevent reordering attacks. See issue #345

@r-marques
Copy link
Contributor

I think that the easiest way would be to just check for duplicated txids

@ttmc
Copy link
Contributor Author

ttmc commented Jul 11, 2016

@r-marques Yes, and duplicate transactions will be checked-for once issue #131 is resolved. I'd like to leave this issue open to be revisited from time-to-time, until the core code is more stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants