September 10, 2025

Signed and Dangerous: BYOVD Attacks on Secure Boot

By Fabio Pagani, Yegor Vasilenko

The Binarly REsearch team conducted an analysis of signed UEFI modules and the findings show the true scale of the attack surface hidden inside Secure Boot’s trust model.  Across thousands of firmware images, we found that modern platforms typically trust approximately 1,500 signed modules, with some builds peaking above 4,000.

That trust isn’t just theoretical. Among these modules we identified the known Secure Boot bypass (CVE-2025-3052), as well as 30 UEFI shells trusted by hundreds of different devices, a finding that has not been publicly discussed to date. These results highlight how the effectiveness of Secure Boot depends not only on cryptographic signatures but also on the security of the signed applications themselves. A vulnerability in any one of these modules could be weaponized to break the chain of trust.

This problem echoes what’s long been observed in Windows with BYOVD (Bring Your Own Vulnerable Driver) attacks.  Signed drivers with exploitable flaws can give attackers kernel-level execution while bypassing security checks, a technique documented by VMware TAU, Cisco Talos, and others.  The same principle now applies at the firmware layer where signed but vulnerable UEFI modules create a new pathway for persistence and privilege escalation.

In this post, we map the landscape, show where the risks reside, and explain why signed UEFI shells represent a systemic weakness rather than isolated mistakes.

Taxonomy of Attacks Against Secure Boot 

Before diving into the technical details, we introduce a new taxonomy of attacks against Secure Boot and signature verification systems found in software and firmware. This taxonomy is intended to help the industry better understand both the threat model and the attack surface exposed by these systems. These categories are based on our experience and previous findings:

  1. Double-use modules: Programs that are trusted but expose a functionality that can be misused to run untrusted code. 
  2. Trusted but vulnerable modules: Programs that are signed with a trusted key but contain exploitable vulnerabilities. 
  3. Leaked private keys: Keys used in verification that are compromised, allowing attackers to sign malicious modules. 
  4. Verification logic bugs: Bugs in the verification process itself that allows an attacker to bypass verification.
  5. Debug or incomplete features: Features that disable or bypass verification ending up in production devices, despite being intended only for debugging or testing.

The  following list has an example for each of the previous categories:

  1. Double-use modules: The UEFI shell and in particular the mm command, which is intended for debugging but can write arbitrary values directly to memory and thus can be leveraged to execute untrusted code.
  2. Trusted but vulnerable modules: Most of the modules that are blocked by Microsoft’s dbx. For example, the Microsoft-signed UEFI driver which contains a memory corruption vulnerability that can be exploited during boot (CVE-2025-3052). 
  3. Leaked private keys: PKFail, originally disclosed by Binarly, where Secure Boot test keys were exposed in a leak and could be used to sign any arbitrary modules.
  4. Verification logic bugs:  The upcoming CVE-2025-6198, where Binarly found a bug in the BMC firmware validation logic, which allows to update the system firmware with a specially crafted image.
  5. Debug or incomplete features: A function stub checking for physical presence wasn’t implemented by downstream vendors and always returned true (CVE-2021-0114).

While the taxonomy is mostly based on our previous findings and might be incomplete, we believe it represents a solid starting point. In this blog, we focus mostly on double-use modules and trusted but vulnerable modules in the context of UEFI, since both categories are central to BYOVD. In particular, we will show how we discovered these modules and how they can be leveraged to bypass Secure Boot.  

Creating a Large Database of Signed Modules

Creating a dataset of UEFI firmware and modules was the first challenge in this research: the larger the dataset, the more signed modules it contains. We built the initial dataset from three sources:

  1. An internal collection of UEFI firmware gathered over the past five years
  2. Private telemetry data, such as firmware images uploaded to the pk.fail detector
  3. Public threat intelligence feeds, including VirusTotal  

Each file in the dataset was automatically unpacked, allowing extraction of any firmware image or standalone UEFI application. We then indexed every UEFI module in a modules database containing information about the module, including its name, GUID, Authenticode hashes, and certificate data used for signing the module when available. The database contains more than 10 million modules, with around 8900 of them signed.  

Figure 1. Ten signed modules randomly selected from the modules database

Which Modules Do Firmware Trust?

After building the modules database, the next step was to determine which firmware trusts the modules it contains. From our internal dataset, we analyzed roughly 4000 unique firmware images released over the past four years by major OEMs. These images span a wide range of devices, from consumer hardware to enterprise-grade servers. Using the database, we  identified which modules each firmware image would permit to run. To do this, we extracted the db and dbx from the firmware and checked whether they would allow or block execution of the modules (our previous blogpost on this topic explains how the verification works).

In total, the selected firmware allows the execution of 7,157 modules present in the database with  16% of these modules signed by one of the Microsoft UEFI keys (e.g., Microsoft Corporation UEFI CA 2011), while the remainder were signed with OEM keys. Only five modules were unsigned but still trusted, meaning their hashes had been intentionally added to the Secure Boot db.

Finding Secure Boot bypasses

The next natural step of this REsearch was searching for double-use modules and for trusted but vulnerable modules.

In terms of trusted but vulnerable modules, we found CVE-2025-3052. This already disclosed vulnerability affects a BIOS-flashing tool signed with Microsoft’s third-party UEFI certificate. This tool uses the content of a NVRAM variable as a pointer for memory writes, making it straightforward for an attacker to corrupt memory.  

In terms of double-use modules we instead searched for UEFI shells, since it offers a number of potentially dangerous commands, including the built-in mm command. The mm command can be used to write to memory and thus, eventually, to run unsigned code. For example:

Shell> mm 0x11223344 DDCCBBAA -w 4 -mem

This command writes the value 0xAABBCCDD to the memory address 0x11223344. In addition, the UEFI shell automatically executes any commands listed in the startup.nsh file. This behavior allows an attacker to insert arbitrary commands into this file and have them run during the boot process.  

Figure 2. The mm command in action

In total, we discovered 30 trusted UEFI shells, affecting seven (7) different OEMs and hundreds of devices. Most UEFI shells are allowed to be executed because they are successfully verified against the OEM certificate stored in the Secure Boot signature database db. The only exception is one UEFI shell affecting a specific OEM, which is trusted because its Authenticode hash has been explicitly added to the Secure Boot signature database db. We shared our findings with CERT/CC at the end of August under coordinated vulnerability disclosure principles. We will share full details of the trusted shells and affected devices later this year.

We believe the number of trusted UEFI shells in the wild is likely much higher, as 16 out of 30 discovered shells were identified through a Retrohunt scan on VirusTotal, which is limited to the last year of submissions. This suggests that attackers have a broader opportunity to abuse UEFI shells than current visibility indicates, making the threat surface potentially larger.

From Trusted Shell to Untrusted Code Execution

The mm command present in the UEFI shell provides a powerful arbitrary write primitive that can be exploited in multiple ways. This command can be used to disable Secure Boot and execute untrusted code.

The core idea is to overwrite the global variable gSecurity2, which is normally pointed to by the Security2 Architectural Protocol. This protocol is used by the `LoadImage` function to enforce Secure Boot. Zeroing out this variable will bypass the signature verification logic, enabling an attacker to load and execute any unsigned UEFI modules. 

We developed and tested a simple PoC based on the described idea:

  1.  From a privileged OS shell, perform the following steps on system with Secure Boot enabled:
  • Copy the UEFI shell binary and the startup.nsh script to the EFI System Partition (ESP).
  • Place a second unsigned UEFI module (the payload) on the partition.
  • Reconfigure the UEFI Boot Manager to run the UEFI shell before the unsigned module at startup.
  1. After rebooting the device:
  • The Boot Manager runs the UEFI shell.
  • The UEFI shell automatically executes startup.nsh, which issues an mm command to zero gSecurity2.
  • The unsigned module containing the malicious payload executes successfully.

Hardening the UEFI Shell

Signed UEFI shells are not new and have been sporadically discovered in the past (e.g., CVE-2023-49721 and CVE-2023-48733). In response to these discoveries, the reference implementation EDK2 disabled building the UEFI shell when support for Secure Boot is enabled. This is a positive step, as it prevents the UEFI shell from being included in the final firmware image.

However, since IBVs and OEMs may use different build configurations that don’t include this recent change, we propose additional measures. Specifically, when Secure Boot is enabled, the UEFI shell should be modified to:

  • Avoid execution of commands from startup.nsh, or allow them only after physical presence is verified.
  • Block any dangerous command, such as the mm command.

Implementing both of these changes would block attackers even if a UEFI shell is accidentally signed, preventing a remote attacker from bypassing Secure Boot.

How the Binarly Transparency Platform Uncovers Hidden Firmware Risks

While Secure Boot may seem straightforward on paper, it is actually a complex topic with many facets. The Binarly Transparency Platform (BTP) is designed to address a variety of scenarios and empower both product and security teams. In particular, the platform provides:

  • Detailed reporting on the certificates present in a firmware image and used for signing UEFI modules, enabling quick identification of exactly what the firmware trusts.
  • Unknown vulnerability scanning, ensuring that only safe modules without vulnerabilities are signed. Once a vulnerable module is signed and released publicly, it must be assumed that attackers could leverage it to bypass Secure Boot. Revoking a module requires either adding its Authenticode hash to dbx or removing the signing certificate from db.
  • Alerts if the analyzed firmware image trusts any of the signed shells detected during this research.

What's lurking in your firmware?