Cloudanix VulnDB

CVE-2024-29040

Medium · 4.3

CVSS

4.3

EPSS

0.3%

Published

Jun 28, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A verification step meant to confirm a device's trusted state could accept fake information, letting untrusted devices gain access they should not have.

Exploitation
Local Privilege
Attacker needs
None
Complexity
Low
Impact
Data Exposure
Component
Library
Class
Improper Input Validation
Remediation
Upgrade
Effort
Low
Patch risk
Low

What it actually does

Improper input validation in Fapi_VerifyQuote allows the TPM2_GENERATED magic field of the deserialized TPMS_ATTEST structure to accept arbitrary values from JSON Quote Info produced by Fapi_Quote, bypassing checks that the reported state matches the actual device state.

Why it matters to the business

Organizations relying on TPM-based attestation for device identity or access control may grant data access or service permissions to compromised or malicious devices that should be denied, increasing risk of unauthorized data exposure or lateral movement.

How an attack unfolds

An attacker controlling a device under attestation crafts a JSON quote response containing an arbitrary or attacker-chosen TPM2_GENERATED magic value; the verifier calling Fapi_VerifyQuote accepts the malformed structure without validation, treating the malicious device state as authentic and granting access to protected resources.

How to fix it

Upgrade the TPM2 TSS library to version 4.1.0 or later where the deserialization of the TPM2_GENERATED magic field now enforces the expected constant value; rebuild and redeploy any applications statically or dynamically linking the affected library.

How to confirm the fix worked

Confirm the installed tpm2-tss package or library reports version 4.1.0 or newer; re-run attestation flows with a test device supplying an invalid magic value and verify the verifier now rejects the quote.

Typical attack path

  1. Identify a system or service that performs remote attestation using Fapi_Quote and Fapi_VerifyQuote from the TPM2 TSS library
  2. Compromise or emulate a target device to control quote generation
  3. Craft and return a JSON quote with an invalid or attacker-supplied magic value in the TPMS_ATTEST structure
  4. Submit the quote to the verifier which deserializes without enforcing the expected magic constant
  5. Obtain access to data or services that the verifier would otherwise deny based on correct attestation

How to detect it

Review application or attestation service logs for Fapi_VerifyQuote calls that succeed despite receiving JSON structures containing unexpected or non-standard magic values; look for attestation success events followed by access to protected resources from devices whose reported PCRs or state later prove inconsistent.

What your security team should do

  • Prioritize upgrade of tpm2-tss to 4.1.0 across all attestation-dependent systems within the next maintenance window
  • Audit code and configurations that invoke Fapi_VerifyQuote to ensure they treat verification failures as hard denials
  • Add monitoring for unexpected attestation failures or repeated quote submissions from the same device identifiers

The record

This repository hosts source code implementing the Trusted Computing Group's (TCG) TPM2 Software Stack (TSS). The JSON Quote Info returned by Fapi_Quote has to be deserialized by Fapi_VerifyQuote to the TPM Structure `TPMS_ATTEST`. For the field `TPM2_GENERATED magic` of this structure any number can be used in the JSON structure. The verifier can receive a state which does not represent the actual, possibly malicious state of the device under test. The malicious device might get access to data it shouldn't, or can use services it shouldn't be able to. This issue has been patched in version 4.1.0.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 tpm2-tss 0 No fix
Debian:12 tpm2-tss 0 No fix
Debian:13 tpm2-tss 0 No fix
Mageia:9 tpm2-tss 0 4.0.2-1.mga9
SUSE:Linux Enterprise Micro 5.3 tpm2-0-tss 0 3.1.0-150400.3.6.1
SUSE:Linux Enterprise Micro 5.4 tpm2-0-tss 0 3.1.0-150400.3.6.1
SUSE:Linux Enterprise Micro 5.5 tpm2-0-tss 0 3.1.0-150400.3.6.1
SUSE:Linux Enterprise Module for Basesystem 15 SP5 tpm2-0-tss 0 3.1.0-150400.3.6.1
Ubuntu:20.04:LTS tpm2-tss 0 2.3.2-1ubuntu0.20.04.2
Ubuntu:22.04:LTS tpm2-tss 0 3.2.0-1ubuntu1.1
Ubuntu:23.10 tpm2-tss 0 4.0.1-3ubuntu1.1
Ubuntu:24.04:LTS tpm2-tss 0 4.0.1-7.1ubuntu5.1
openSUSE:Leap 15.5 tpm2-0-tss 0 3.1.0-150400.3.6.1
openSUSE:Leap Micro 5.3 tpm2-0-tss 0 3.1.0-150400.3.6.1
openSUSE:Leap Micro 5.4 tpm2-0-tss 0 3.1.0-150400.3.6.1

Related vulnerabilities