USENIX Security2023Top-tier venue
Hash Gone Bad: Automated discovery of protocol attacks that exploit hash function weaknesses
Vincent Cheval, Cas Cremers, Alexander Dax, Lucca Hirschi, Charlie Jacomme, Steve Kremer
Abstract
Most cryptographic protocols use cryptographic hash functions as a building block. The security analyses of these protocols typically assume that the hash functions are perfect (such as in the random oracle model). However, in practice, most widely deployed hash functions are far from perfect -and as a result, the analysis may miss attacks that exploit the gap between the model and the actual hash function used. We develop the first methodology to systematically discover attacks on security protocols that exploit weaknesses in widely deployed hash functions. We achieve this by revisiting the gap between theoretical properties of hash functions and the weaknesses of real-world hash functions, from which we develop a lattice of threat models. For all of these threat models, we develop fine-grained symbolic models. Our methodology's fine-grained models cannot be directly encoded in existing state-of-the-art analysis tools by just using their equational reasoning. We therefore develop extensions for the two leading tools, TAMARIN and PROVERIF. In extensive case studies using our methodology, the extended tools rediscover all attacks that were previously reported for these protocols and discover several new variants. 2 128 ✓ 2 256 ✗ SHA2-512 2001 TLS, SSL, SSH, S/MIME, IPSec, DNSSEC, Linux/Unix password hashing ✓ 2 256 ✓ 2 512 ✗ SHA3-256 2012 Ethereum ✓ 2 128 ✓ 2 256 ✓ ✓= currently still secure ⊗=weak, but no full attack yet ✗= known attack * = Theoretical attacks on (second) preimage resistance were found [54] [44], but they are still not feasible. ** = The small bit size allows to find collisions in practice, but doing so is not necessarily feasible. Table 1 : Examples of widely used hash functions that are currently deployed in security protocols and do not offer perfect (randomoracle like) guarantees. The numbers indicate the complexity of the currently best known attack on the property [32, 44, 45, 53, 54] . For the hash functions currently deemed secure the best known attacks would be a brute-force approach; e.g., the complexity to break collision resistance on SHA2-256 is 2 128 . Crucially, this situation is not constant, but expected to get worse: history suggests that the numbers for the best attacks are likely to decrease over time for all hashes, see e.g., [2, 48] . This raises the natural question: how can we check if a protocol using a hash function with a particular weakness meets its security guarantees? History has shown such attacks are rare but can be very subtle, e.g., [9, 48, 49] , and thus difficult to detect manually. From a cryptographic perspective, the answer would be: provide a computational proof of the security of the entire protocol, and if this proof relies on assumptions not met by the hash function, this may indicate an attack. However, for most protocols, this task ranges from daunting to infeasible; and most existing protocol proofs simply assume that the hash function is perfect, by using the ROM. In contrast, automated protocol analysis tools have shown to be effective for analyzing real-world protocols [5, 6, 8, 16, 18, 28] . However, they model hash functions as being perfect (traditionally as an operator in a free term algebra). Thus, like computational proofs that use the ROM, such analyses miss any attacks that exploit the use of a non-perfect hash function. In this work, we revisit cryptographic hash function definitions, common weaknesses, and the potential attacker capabilities that arise from them. Based on this, we develop a methodology to systematically discover attacks on protocols that exploit their use of "less-than-perfect" hash functions, and show how this can be implemented in the two leading protocol-analysis tools. To realize this, we both exploit advanced features of these tools (such as equational theories, event-based modeling, and restrictions) but we in fact also extend them (partial support for associative operators, recursive computation functions). Our methodology can be used in the design phase to avoid the use of hash functions that are too weak, or to find and fix problems in deployed protocols. Contributions. 1. We develop the first systematic, automated methodology to find protocol attacks that exploit weaknesses of real-world hash functions. At a technical level, we achieve this by symbolically modeling cryptographic weaknesses (i.e., the lack of desirable cryptographic properties) as well as real-world attack classes that are not captured by classical security definitions for cryptographic hash functions. 2. We automate our methodology in the two leading automated protocol analysis tools, TAMARIN and PROVERIF. To achieve this, we (a) propose dedicated modeling techniques, and (b) extend both tools with new required features that are of independent interest beyond this work. 3. We apply our methodology to over 20 protocols, automatically rediscovering all previously reported attacks on those protocols that exploit weak hash functions, as well a
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 2444e372-9c61-4241-b511-11848afed501Cited by top-tier papers8
- Keeping Up with the KEMs: Stronger Security Notions for KEMs and Automated Analysis of KEM-based ProtocolsCas Cremers, Alexander Dax, Niklas MedingerCCS 2024 · 11 citations
- An Extended Hierarchy of Security Notions for Threshold Signature Schemes and Automated Analysis of Protocols That Use ThemCas Cremers, Aleksi Peltonen, Mang ZhaoCCS 2026 · 4 citations
- Shaken, not Stirred - Automated Discovery of Subtle Attacks on Protocols using Mix-NetsJannik Dreier, Pascal Lafourcade, Dhekra MahmoudUSENIX Security 2024 · 2 citations
- Automated Analysis of Protocols that use Authenticated Encryption: How Subtle AEAD Differences can impact Protocol SecurityCas Cremers, Alexander Dax, Charlie Jacomme, Mang ZhaoUSENIX Security 2023
- The SecureDrop Protocol: End-to-End Encrypted Whistleblowing for AllGiulio Berra, Felix Linker, Luca Maier, Cory Francis Myers et al.CCS 2026
Builds on9
- A Formal Analysis of 5G AuthenticationDavid A. Basin, Jannik Dreier, Lucca Hirschi, Sasa Radomirovic et al.CCS 2018 · 428 citations
- Verified Models and Reference Implementations for the TLS 1.3 Standard CandidateKarthikeyan Bhargavan, Bruno Blanchet, Nadim KobeissiS&P 2017 · 233 citations
- Transcript Collision Attacks: Breaking Authentication in TLS, IKE and SSHKarthikeyan Bhargavan, Gaëtan LeurentNDSS 2016 · 128 citations
- The EMV Standard: Break, Fix, VerifyDavid A. Basin, Ralf Sasse, Jorge Toro-PozoS&P 2021 · 69 citations
- ProVerif with Lemmas, Induction, Fast Subsumption, and Much MoreBruno Blanchet, Vincent Cheval, Véronique CortierS&P 2022 · 61 citations
Related papers
- Seems Legit: Automated Analysis of Subtle Attacks on Protocols that Use SignaturesDennis Jackson, Cas Cremers, Katriel Cohn-Gordon, Ralf SasseCCS 2019 · 53 citations
- Block Ciphers in Idealized Models: Automated Proofs and New Security ResultsMiguel Ambrona, Pooya Farshim, Patrick HarasserCCS 2024
- New Records in Collision Attacks on SHA-2Yingxin Li, Fukang Liu, Gaoli WangEUROCRYPT 2024 · 14 citations
- Pushing the Limit of Memory-Efficient Collision Attack Framework for SHA-2Yingxin Li, Fukang Liu, Gaoli Wang, Jiali ShiCRYPTO 2026
- A Sound Translation from Tamarin to ProVerif: Enabling Comparative AnalysisKevin Morio, Yavor Ivanov, Robert KünnemannCCS 2026
