Groovy : HMAC using weak hashing algorithm
Classification
OWASP Top 10 2013 A6-Sensitive Data Exposure OWASP Top 10 2017 A3-Sensitive Data Exposure OWASP Top 10 2021 A2-Cryptographic Failures A4-Insecure Design OWASP MASVS V8: 8.13.(L1+R/L2+R) OWASP ASVS Stored Cryptography Stored Cryptography Stored Cryptography Authentication PCI DSS 4.0 3.6.1 6.2.4 8.3.2 HIPAA §164.312 (c)(1) §164.312 (e)(2)(i) CWE CWE-326 CWE-1032Overview
The used hash function in HMAC is insecure. Its use can lead to a data confidentiality loss.
In cryptography, a keyed-hash message authentication code (HMAC) is a specific type of message authentication code (MAC) involving a cryptographic hash function in combination with a secret cryptographic key.
The cryptographic strength of the HMAC depends upon the cryptographic strength of the underlying hash function, the size of its hash output, and on the size and quality of the key.
The MD2, MD5, SHA1 hash functions have known vulnerabilities. Finding collisions for MD2 and MD5 functions do not require substantial resources; a similar problem of finding collisions for SHA1 was also solved.
In order to protect valuable data, use well tested implementations of standard encryption algorithms with sufficiently long keys.
Insufficient Cryptography vulnerabilities take the fifth place in the “OWASP Mobile Top 10 2016” mobile application vulnerabilities ranking.
References
- OWASP: Top 10 2017-A3-Sensitive Data Exposure
- OWASP: Top 10 2013-A6-Sensitive Data Exposure
- OWASP: Top 10 2010-A7-Insecure Cryptographic Storage
- CWE-326: Inadequate Encryption Strength
- NIST Approved Algorithms
- MD5 considered harmful today. Creating a rogue CA certificate – Alexander Sotirov, Marc Stevens, Jacob Appelbaum, Arjen Lenstra, David Molnar, Dag Arne Osvik, Benne de Weger / win.tue.nl
- Encrypting and Hashing Data - developer.apple.com
- CWE-327
- CWE-328
- CWE CATEGORY: OWASP Top Ten 2017 Category A6 - Security Misconfiguration
- Bleichenbacher’s attack
- Transport Layer Security (TLS) Parameters