]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: jwe: fix timing side-channel and dead code in JWE decryption
authorDavid Carlier <devnexen@gmail.com>
Sat, 14 Feb 2026 16:16:58 +0000 (16:16 +0000)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 18 Feb 2026 09:46:32 +0000 (10:46 +0100)
commitfc89ff76c7038fef8aca51ca1d07c21e88458525
treebea7c120f6ba3c0a61779e1766b339a1e49e3866
parent806c8c830d69ab09383a6d42a879b2344e3e6989
BUG/MEDIUM: jwe: fix timing side-channel and dead code in JWE decryption

Fix two issues in JWE token processing:

- Replace memcmp() with CRYPTO_memcmp() for authentication tag
  verification in build_and_check_tag() to prevent timing
  side-channel attacks. Also add a tag length validation check
  before the comparison to avoid potential buffer over-read when
  the decoded tag length doesn't match the expected HMAC half.

- Remove unreachable break statement after JWE_ALG_A256GCMKW case
  in decrypt_cek_aesgcmkw().
src/jwe.c