Skip to content
.ca
4 minhigh

What we learned about TEE security from auditing WhatsApp's Private Inference

An audit of WhatsApp's Private Inference feature revealed critical implementation flaws in its Trusted Execution Environment (TEE) deployment. Vulnerabilities included unmeasured environment variables, unverified ACPI tables, and missing attestation freshness guarantees, which could have allowed attackers to bypass privacy protections and access plaintext data before Meta patched the issues.

Sens:LowConf:highAnalyzed:2026-04-07reports

Authors: Trail of Bits

Source:Trail of Bits

Improve this report

Send corrections, useful missing information, or quality feedback. It is private and will not appear as a comment.

Feedback type

Key Takeaways

  • WhatsApp's Private Inference TEE implementation contained 28 vulnerabilities (8 high-severity) prior to launch, all of which have been patched by Meta.
  • Unmeasured environment variables allowed potential malicious code injection (e.g., via LD_PRELOAD) without invalidating the TEE attestation.
  • Unmeasured ACPI tables could allow a malicious hypervisor to inject fake devices and read/write protected memory.
  • Attestation reports lacked freshness guarantees, enabling potential replay attacks using compromised TLS keys.
  • Firmware patch levels were trusted based on claims rather than verified against cryptographic certificates like AMD's VCEK.

Affected Systems

  • WhatsApp Private Inference
  • AMD SEV-SNP
  • Nvidia confidential GPUs
  • Trusted Execution Environments (TEEs)

Vulnerabilities (CVEs)

  • TOB-WAPI-13 (Audit Finding)
  • TOB-WAPI-17 (Audit Finding)
  • TOB-WAPI-8 (Audit Finding)
  • TOB-WAPI-7 (Audit Finding)
  • TOB-WAPI-10 (Audit Finding)
  • TOB-WAPI-18 (Audit Finding)

Attack Chain

A malicious insider or compromised hypervisor targets the TEE boot and attestation process. The attacker injects malicious environment variables or alters ACPI tables before the enclave fully secures its memory, successfully bypassing attestation measurements. Once the enclave boots, the injected code or fake hardware devices extract plaintext user messages or encryption keys from the TEE. Alternatively, the attacker replays a stolen, stale attestation report to spoof a legitimate Meta server and intercept client connections.

Detection Engineering Assessment

Required Log Sources

  • TEE attestation logs
  • Secure bootloader logs
  • Hypervisor logs

Hunting Hypotheses

copy:
HypothesisTelemetryATT&CK StageFP Risk
Clients or servers are accepting TEE attestation requests that lack cryptographic freshness nonces (e.g., TLS client_random), indicating a potential replay attack.Network traffic (TLS handshakes), Application authentication logsCredential Access/Defense EvasionLow
Unexpected or unmeasured environment variables are being passed to the TEE during the secure boot sequence.Hypervisor logs, Secure bootloader logsExecutionMedium

Control Gaps

  • Traditional EDR cannot inspect TEE memory.
  • Standard network IDS cannot decrypt TEE-bound traffic.

Key Behavioral Indicators

  • Mismatched firmware patch levels in attestation vs. VCEK certificates
  • Missing client_random nonces in attestation reports
  • Unexpected environment variables in TEE boot configuration

False Positive Assessment

  • Low

Recommendations

Immediate Mitigation

  • Validate all environment variables passed to TEEs, restricting them to safe characters and explicitly blocking dangerous variables like LD_PRELOAD.

Infrastructure Hardening

  • Implement custom bootloaders that verify ACPI table signatures during the secure boot process.
  • Validate TEE firmware patch levels against cryptographic certificates (e.g., AMD VCEK X.509 extensions) rather than relying on self-reported claims.

User Protection

  • Ensure client applications enforce attestation freshness by including a TLS client_random nonce in every attestation report to prevent replay attacks.

Security Awareness

  • Conduct comprehensive negative testing on TEE components to evaluate system behavior under malicious inputs or misconfigurations.

MITRE ATT&CK Mapping

  • T1574.006 - Hijack Execution Flow: Dynamic Linker Hijacking
  • T1565.001 - Data Manipulation: Stored Data Manipulation
  • T1550 - Use Alternate Authentication Material