CVE-2025-2884: Tpm2 Missing Hmac Sigalg Check

A TPM signature structure is accessed for HMAC operations (reading `any.hashAlg` and accessing `hmac.digest`) without validating that the signature algorithm tag (`sigAlg`) is actually `TPM_ALG_HMAC`. This can lead to an out-of-bounds memory read due to union type confusion. Always verify the signature algorithm type.

Provally CuratedPublic repositoryMediumMedium confidenceVerifiedApache-2.0C
greprules fetch cve-2025-2884-tpm2-missing-hmac-sigalg-check --engine opengrep

Description

A TPM signature structure is accessed for HMAC operations (reading `any.hashAlg` and accessing `hmac.digest`) without validating that the signature algorithm tag (`sigAlg`) is actually `TPM_ALG_HMAC`. This can lead to an out-of-bounds memory read due to union type confusion. Always verify the signature algorithm type.