python-jose 3.5.0: Incomplete Fix for CVE-2024-33663 — DER-Encoded Keys Bypass Algorithm Confusion Guard
The fix for CVE-2024-33663 in python-jose 3.5.0 added guards in HMACKey.__init__() that check is_pem_format(key) and is_ssh_key(key) to prevent asymmetric public keys from being used as HMAC secrets. However, DER-encoded (binary) public keys bypass both checks, enabling the same algorithm confusion attack that CVE-2024-33663 was intended to fix.
Affected version: python-jose 3.5.0 (latest release) CWE: CWE-327 (Use of a Broken or Risky Cryptographic Algorithm)