Skip to content

DEF CON 34 talks are here: 354 talks, summarized and searchable.

Browse DEF CON 34

The HMAC Trap: Security or Illusion?

Marluan "Izzny" Cleary

AppSecPasswordsCon39 minIntermediateOpen on YouTube ↗

Where

PasswordsCon
BSides Las Vegas

Duration

39 min

Shows how HMAC misuse, weak keys, replay gaps and timing leaks can break authentication in systems that look secure.

Summary

The talk examines how HMAC, a keyed hash used to confirm that a message is authentic and unchanged, gets misused in authentication. The speaker built a small Python client and server lab, first with MD5 and then SHA-256, and showed that a captured message and tag can be cracked offline when the key is weak. Intercepting traffic through a proxy showed that tampered messages and tags were rejected, yet recovering the key let forged messages pass.

Further demos covered a dictionary attack against an admin account's key, replay of messages when timestamps were missing or ignored, and a timing side channel created by a non-constant-time tag comparison. A logic flaw where the server accepted any tag was also shown, along with JSON Web Tokens that accepted the none algorithm or used a guessable signing secret. Each case was presented as a simple proof of concept.

The practical guidance centred on key management: long random keys rather than passwords, rotation and revocation, never hardcoding keys, least-privilege access, timestamps and nonces to block replay, constant-time comparison functions, and rejecting the none algorithm in tokens. The closing point was that HMAC itself is not broken but is often misused and mismanaged. Audience questions covered whether timing attacks are practical over a network, whether password-derived keys are acceptable, and the effect of quantum computing, and the speaker left the network timing question open.

Related talks

Talks·52 min

  • CactusCon
  • AppSec
  • Date: Feb 2026
  • Location: AZ

Nicholas Anastasi · Juan Pablo Gomez Postigo

Shows how a trusted proxy header bypassed authentication in popular self-hosted Servarr media applications.

appsecopen-sourcevulnerabilities+2