Skip to content

Cryptographic vulnerabilities: Key as IV, insecure HMAC comparison#58

Merged
mdipierro merged 2 commits intoweb2py:masterfrom
mwielgoszewski:master
Feb 10, 2013
Merged

Cryptographic vulnerabilities: Key as IV, insecure HMAC comparison#58
mdipierro merged 2 commits intoweb2py:masterfrom
mwielgoszewski:master

Conversation

@mwielgoszewski
Copy link
Contributor

I defined AES_new as a function that returns an AES cipher object and a new secure random IV if None was specified. If an attacker can exhibit control over any ciphertext fed to the decrypter, recovering the secret key is a trivial exercise as described in Key as Initialization Vector.

See the following gist for an example showing how this can be exploited.

I also noticed compare() provides a contant-time comparison function for comparing HMAC signatures, however was never called anywhere. This patch updates the secure_loads() function to use compare() when comparing HMAC signatures.

mdipierro added a commit that referenced this pull request Feb 10, 2013
Cryptographic vulnerabilities: Key as IV, insecure HMAC comparison
@mdipierro mdipierro merged commit a634c05 into web2py:master Feb 10, 2013
matclab pushed a commit to matclab/web2py that referenced this pull request Jan 12, 2016
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