Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2021-28216

CVE-2021-28216: Tianocore EDK II NVRAM Data Vulnerability

CVE-2021-28216 is an NVRAM data handling flaw in Tianocore EDK II where BootPerformanceTable pointer is read from NVRAM in PEI. This article covers the technical details, affected versions, and mitigations.

Updated:

CVE-2021-28216 Overview

CVE-2021-28216 affects TianoCore EDK II, the open-source reference implementation of the Unified Extensible Firmware Interface (UEFI). The vulnerability stems from the Pre-EFI Initialization (PEI) phase reading the BootPerformanceTable pointer directly from an NVRAM variable. An attacker with local privileges who can modify NVRAM contents can supply an arbitrary pointer that firmware code later dereferences. This enables firmware-level memory corruption and code execution during early boot. The flaw is tracked under [CWE-587] (Assignment of a Fixed Address to a Pointer) and [CWE-763] (Release of Invalid Pointer or Reference).

Critical Impact

Local attackers with write access to NVRAM variables can corrupt firmware memory and gain code execution during the PEI phase, undermining Secure Boot and platform integrity.

Affected Products

  • TianoCore EDK II (reference UEFI implementation)
  • Downstream UEFI firmware builds derived from EDK II
  • Debian LTS distributions packaging EDK II (per the Debian LTS advisory)

Discovery Timeline

  • 2021-08-05 - CVE-2021-28216 published to NVD
  • 2025-06 - Debian LTS announcement issued for affected EDK II packages
  • 2025-11-03 - Last updated in NVD database

Technical Details for CVE-2021-28216

Vulnerability Analysis

The issue resides in EDK II's Firmware Performance Data Table (FPDT) S3 resume support. During the PEI phase, firmware retrieves the BootPerformanceTable pointer from an NVRAM variable that is writable from the operating system. Because PEI code trusts this value without validation, an attacker who controls the NVRAM entry can supply a pointer to attacker-chosen memory. Subsequent reads and writes against this pointer occur in the highly privileged firmware execution context, before kernel and OS protections are established. The mention of PcdFirmwarePerformanceDataTableS3Support in the advisory indicates the affected code path is the S3 (suspend-to-RAM) resume performance reporting feature.

Root Cause

The root cause is improper trust of mutable, non-volatile storage as a source of kernel-level pointers. PEI modules consume an NVRAM variable whose integrity is not guaranteed against an OS-level adversary. There is no validation that the supplied address resides within expected firmware-owned memory regions. This pattern aligns with [CWE-587] and [CWE-763], where firmware operates on an untrusted or invalid pointer reference.

Attack Vector

Exploitation requires local access with sufficient privileges to write UEFI NVRAM variables, typically administrator or root. The attacker writes a crafted value to the relevant NVRAM variable, then triggers an S3 suspend and resume cycle. On resume, PEI dereferences the attacker-controlled pointer, enabling memory corruption or controlled writes within the firmware context. Successful exploitation can persist across reboots and bypass OS-level defenses, including Secure Boot trust assumptions.

No public proof-of-concept exploit is listed for this CVE. Technical specifics are documented in TianoCore Bug Report #2957.

Detection Methods for CVE-2021-28216

Indicators of Compromise

  • Unexpected modifications to UEFI NVRAM variables related to firmware performance data, particularly entries consumed by FPDT S3 support code paths.
  • Unexplained S3 suspend/resume cycles initiated from privileged user space shortly after NVRAM variable writes.
  • Firmware integrity measurement changes reported by TPM PCR values covering PEI modules.

Detection Strategies

  • Monitor calls to SetFirmwareEnvironmentVariable on Windows and writes to /sys/firmware/efi/efivars/ on Linux from non-administrative processes or unexpected binaries.
  • Compare UEFI variable inventories against a known-good baseline collected from validated firmware images.
  • Use platform attestation and measured boot logs to identify deviations in PEI phase measurements.

Monitoring Recommendations

  • Collect EFI variable write events and correlate with subsequent power state transitions to S3.
  • Alert on process executions invoking efivar, chattr -i on efivars, or direct writes to firmware variable paths.
  • Track kernel logs for firmware exceptions or unexpected PEI errors after resume events.

How to Mitigate CVE-2021-28216

Immediate Actions Required

  • Apply firmware updates from the platform vendor that incorporate the upstream EDK II fix for TianoCore Bug #2957.
  • On Debian LTS systems, update the edk2 package per the Debian LTS Announcement.
  • Restrict local administrative access and audit accounts capable of writing UEFI NVRAM variables.

Patch Information

The upstream remediation is tracked in TianoCore Bug Report #2957. The advisory recommends setting the platform configuration database token PcdFirmwarePerformanceDataTableS3Support to FALSE when the S3 performance reporting feature is not required. Distribution-level packages are addressed in the Debian LTS Announcement.

Workarounds

  • Disable S3 sleep states in firmware setup where operational requirements permit, eliminating the vulnerable code path at resume.
  • Set PcdFirmwarePerformanceDataTableS3Support to FALSE in platform builds derived from EDK II to skip the affected NVRAM-driven pointer read.
  • Enforce immutability of efivars on Linux for non-essential variables and limit root-equivalent process inventory on the system.
bash
# Configuration example: disable FPDT S3 support in an EDK II platform DSC file
[PcdsFixedAtBuild]
  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwarePerformanceDataTableS3Support|FALSE

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.