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 length extension attack on network seed #9

Merged
merged 1 commit into from
Nov 23, 2018

Conversation

Fang-
Copy link
Member

@Fang- Fang- commented Nov 23, 2018

As described in urbit/urbit-key-generation#55, the use of SHA2-256 in networking seed derivation is vulnerable to length-extension attacks. This change patches that vulnerability.

Since network seeds have already been generated with revision 0, that case needs to remain backwards-compatible, and thus will not change. All other cases will change, doing SHA2-256d (hashing twice with SHA2-256) to protect against length extension attacks.

Note that network seeds generated with revision 0 are not vulnerable to length extension attacks themselves, because the revision number as part of the salt should never have unnecessary leading zeroes.

As described in urbit/urbit-key-generation#55, the use of SHA2-256 in networking seed derivation is vulnerable to length-extension attacks. This change patches that vulnerability.

Since network seeds have already been generated with revision 0, that case needs to remain backwards-compatible, and thus will not change. All other cases will change, doing SHA2-256d (hashing twice with SHA2-256) to protect against length extension attacks.

Note that network seeds generated with revision 0 are not vulnerable to length extension attacks themselves, because the revision number as part of the salt should never have leading zeroes.
@vvisigoth
Copy link
Contributor

Thanks for handling this, Fang. LGTM

@vvisigoth vvisigoth merged commit c292dfa into urbit:master Nov 23, 2018
@Fang- Fang- deleted the patch-1 branch November 23, 2018 21:29
Fang- added a commit to urbit/arvo that referenced this pull request Nov 23, 2018
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

Successfully merging this pull request may close these issues.

2 participants