Skip to content

cipher: validate iterations argument for Cipher#pkcs5_keyivgen - #184

Merged
rhenium merged 1 commit into
ruby:maint-2.0from
rhenium:ky/cipher-pkcs5-keyivgen-validate-iter
Feb 19, 2018
Merged

rhenium merged 1 commit into
ruby:maint-2.0from
rhenium:ky/cipher-pkcs5-keyivgen-validate-iter

Conversation

@rhenium

@rhenium rhenium commented Jan 12, 2018

Copy link
Copy Markdown
Member

EVP_BytesToKey() internally converts the iteration count given as an
"int" into an "unsigned int". Calling that with a negative integer will
result in a hang. This is surprising, so let's validate the value by
ourselves and raise ArgumentError as necessary.

The issue was reported by finixbit at https://hackerone.com/reports/304115 (not public yet)

EVP_BytesToKey() internally converts the iteration count given as an
"int" into an "unsigned int". Calling that with a negative integer will
result in a hang. This is surprising, so let's validate the value by
ourselves and raise ArgumentError as necessary.
@rhenium
rhenium merged commit 8f755f2 into ruby:maint-2.0 Feb 19, 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.

1 participant