# CVE-2024-29040: Fapi Verify Quote: Does not detect if quote was not generated by TPM

> Attackers can bypass TPM quote verification by manipulating JSON fields, potentially gaining unauthorized access to data or services.

- **Severity:** Medium 4.3 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 28 Jun 2024
- **Updated:** 4 Nov 2025
- **Also known as:** AZL-42978, AZL-42985, BELL-CVE-2024-29040, DEBIAN-CVE-2024-29040, GHSA-837m-jw3m-h9p6, MGASA-2024-0171, OESA-2024-1613, OESA-2024-1637, OESA-2024-1638, SUSE-SU-2024:1605-1, SUSE-SU-2024:1635-1, SUSE-SU-2024:1635-2, UBUNTU-CVE-2024-29040, openSUSE-SU-2024:13933-1

## What is CVE-2024-29040?

CVE-2024-29040 is a medium-severity unsafe deserialization vulnerability in tpm2-software tpm2-tss, published on 28 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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.

Weakness: CWE-502 (Deserialization of Untrusted Data)

## Which versions are affected by CVE-2024-29040?


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `tpm2-0-tss` | SUSE:Linux Enterprise Micro 5.3 | All versions | 3.1.0-150400.3.6.1 |
| `tpm2-0-tss` | SUSE:Linux Enterprise Micro 5.4 | All versions | 3.1.0-150400.3.6.1 |
| `tpm2-0-tss` | SUSE:Linux Enterprise Micro 5.5 | All versions | 3.1.0-150400.3.6.1 |
| `tpm2-0-tss` | SUSE:Linux Enterprise Micro 5.5 | All versions | 3.1.0-150400.3.6.1 |
| `tpm2-0-tss` | SUSE:Linux Enterprise Module for Basesystem 15 SP5 | All versions | 3.1.0-150400.3.6.1 |
| `tpm2-0-tss` | openSUSE:Leap 15.5 | All versions | 3.1.0-150400.3.6.1 |
| `tpm2-0-tss` | openSUSE:Leap Micro 5.3 | All versions | 3.1.0-150400.3.6.1 |
| `tpm2-0-tss` | openSUSE:Leap Micro 5.4 | All versions | 3.1.0-150400.3.6.1 |

## How do I fix CVE-2024-29040?

Upgrade to a fixed version.

## Is CVE-2024-29040 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-29040 exists.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-29040 and fix it if it is affected.

What it is: CVE-2024-29040 is a medium-severity unsafe deserialization vulnerability in tpm2-software tpm2-tss, published on 28 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-29040 exists.

Affected product: tpm2-software tpm2-tss. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-29040/ (Markdown: https://insights.sbomify.com/CVE-2024-29040/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-29040
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-29040
- OSV: https://osv.dev/vulnerability/CVE-2024-29040

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-29040/
Summaries are generated and may contain mistakes; the official description above is the record.
