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

Solution 09 is susceptable to replay attacks #21

Open
aral opened this issue Feb 5, 2019 · 2 comments
Open

Solution 09 is susceptable to replay attacks #21

aral opened this issue Feb 5, 2019 · 2 comments

Comments

@aral
Copy link
Contributor

aral commented Feb 5, 2019

At the state we have the bank at the end of 09, it is open to replay attacks as long as someone has access to the log to alter it. All they need to do is to copy an existing command to the end of the log (with a valid hash, which they can easily calculate) and reuse the signature.

As far as I can see, we can mitigate this by signing not the value but the hash. As the hash for each entry is unique, this should thwart replay attacks.

Would you like a PR to the text with these changes?

@aral
Copy link
Contributor Author

aral commented Feb 5, 2019

Ah, I was confused by the wording, it does say to sign the hash, not the transaction but it can be misinterpreted:

When you generate a new hash for a transaction, sign it using the secret key

The it in “sign it” could refer to the hash (which it should) or to the transaction. Given that the latter implementation has a security implication, I feel we should be explicit here:

When you generate a new hash for a transaction, sign the hash using the secret key

I’ll issue a PR for that if that’s cool.

@emilbayes
Copy link
Member

Please do, this was the intention! :)

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

2 participants