Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2022-34302 — Demonstrates CVE-2022-34302, a Secure Boot bypass via the New Horizon Datasys signed bootloader whose built-in custom PE/COFF loader executes unsigned UEFI applications. | Kitploit
Tools/GitHubGitHub/themalwareguardian/cve-2022-34302
Embedded Systems SecurityPersistence MechanismsVulnerability AnalysisExploitationReverse EngineeringHardware SecurityPapers & ResearchPayload DevelopmentFirmware Analysis

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
Binary Exploitation
GitHubthemalwareguardian/cve-2022-34302

CVE-2022-34302

Demonstrates CVE-2022-34302, a Secure Boot bypass via the New Horizon Datasys signed bootloader whose built-in custom PE/COFF loader executes unsigned UEFI applications.

View Repository
10h 5m agoNot yet reviewed

🕷️ CVE-2022-34302 - New Horizon Datasys Boot Loader Vulnerability

New Horizon Datasys Reboot Restore Boot Loader - Bring Your Own Vulnerable UEFI Application (BYOVUA) - Secure Boot bypass via signed bootloader with built-in custom PE/COFF loader that loads unsigned UEFI applications.




📑 Table of Contents

  • Overview
  • Background
    • Bring Your Own Vulnerable UEFI Application
    • The Signed Bootloader
    • The Vulnerability
    • The Custom PE/COFF Loader
    • LoadImage vs Custom Loader
    • PE/COFF Compatibility Requirements
    • Parallel with Kernel BYOVD
  • How It Works
    • Phase 1 - Boot the Signed Bootloader
    • Phase 2 - Custom PE Loader Activates
    • Phase 3 - Unsigned Code Execution
    • Phase 4 - Persistence
  • Exploit
  • Lab Setup
  • References



Overview

This repository demonstrates the BYOVUA (Bring Your Own Vulnerable UEFI Application) technique by exploiting CVE-2022-34302, a Secure Boot bypass vulnerability in the New Horizon Datasys boot loader.

Unlike the UEFI Shell-based vulnerabilities (CVE-2022-34301 and CVE-2022-34303), this bootloader does not expose a UEFI Shell. Instead, shdloader.efi implements its own custom PE/COFF loader that loads a second-stage binary (shdmgr.ef_) without using the firmware's LoadImage() function and without performing any signature verification. An attacker only needs to replace shdmgr.ef_ with any compatible UEFI application to achieve arbitrary code execution with Secure Boot enabled.

This is the most dangerous of the three vulnerabilities disclosed in the "One Bootloader to Load Them All" research. As Eclypsium noted: the bypass is built-in, completely silent, and leaves no visual indication on the screen - making it invisible even on systems with a monitor and undetectable on headless systems such as servers or industrial equipment.




Download Tool

Background


Bring Your Own Vulnerable UEFI Application

BYOVUA is the UEFI equivalent of the BYOVD (Bring Your Own Vulnerable Driver) technique used at the kernel level. Instead of bringing a signed kernel driver with a vulnerability, the attacker brings a signed UEFI application that contains functionality capable of undermining Secure Boot.

Because shdloader.efi is signed with a Microsoft-trusted certificate, it is accepted by Secure Boot without question, making it trusted on any system that includes this certificate in its Secure Boot database (db) - which is virtually every UEFI-capable PC shipped in the last decade. Once running, its built-in custom PE loader provides the attacker with the ability to load and execute arbitrary unsigned code before the operating system loads, in an environment where modern security controls (ASLR, DEP, kernel protections) simply do not exist.


The Signed Bootloader

shdloader.efi is a UEFI boot loader distributed as part of New Horizon Datasys' system restore and recovery products (Reboot Restore Rx, RollBack Rx). Its role in the legitimate boot chain is to load a pre-OS management component (shdmgr.ef_) that handles snapshot and restore operations before the operating system starts.

PropertyValue
Fileshdloader.efi = EFI/Boot/bootx64.efi
VendorNew Horizon Datasys Inc
ProductReboot Restore Rx / RollBack Rx
CVECVE-2022-34302
SigningMicrosoft Windows UEFI Driver Publisher → Microsoft Corporation UEFI CA 2011
DiscoveryEclypsium (Mickey Shkatov, Jesse Michael) - August 2022
PresentationDEF CON 30 - "One Bootloader to Load Them All"
RevocationAdded to DBX via Microsoft KB5012170 (August 2022)

The Vulnerability

The vulnerability is a design flaw in the boot loader's architecture. Rather than using the firmware's LoadImage() and StartImage() boot services - which enforce Secure Boot signature verification - shdloader.efi implements its own custom PE/COFF loader that reads, relocates, and executes shdmgr.ef_ directly from raw disk bytes, completely bypassing the firmware's security checks.

The core issue: a signed binary that is trusted by Secure Boot contains its own image loader that does not verify signatures. The firmware validates shdloader.efi as signed, but once it is running, it loads shdmgr.ef_ without any verification whatsoever. Replacing shdmgr.ef_ with an arbitrary UEFI application results in that application running with full hardware access, while Secure Boot reports as enabled.

This is fundamentally different from CVE-2022-34301 and CVE-2022-34303, where the attacker needs to interact with a UEFI Shell and manually corrupt to disable verification. Here, the bypass is - no user interaction, no visible output, no shell prompt.

gSecurity2
automatic and silent

The Custom PE/COFF Loader

The signed shdloader.efi contains its own implementation of a PE/COFF image loader. Instead of calling the firmware's LoadImage() boot service, which would invoke the Security Architectural Protocols and verify the image's signature against the Secure Boot database, the bootloader:

  1. Opens \EFI\Boot\shdmgr.ef_ using the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL
  2. Reads the raw file contents into a memory buffer
  3. Parses the PE/COFF headers (MZ signature, PE signature, Optional Header)
  4. Allocates memory at an arbitrary address
  5. Copies sections according to the section table
  6. Processes the .reloc section and applies base relocations
  7. Resolves the entry point address
  8. Jumps to the entry point

At no point in this process does the loader verify the image's Authenticode signature, check the Secure Boot database (db/dbx), or invoke the EFI_SECURITY2_ARCH_PROTOCOL. The image is loaded purely based on its PE/COFF structural validity.

root@kitploit:~
// Pseudocode of what shdloader.efi does internally
//
// NOTE: This is a simplified representation. The actual
// implementation was derived from reverse engineering.

EFI_STATUS LoadShdmgr(VOID)
{
	// Step 1: Open the file
	File = OpenFile(L"\\EFI\\Boot\\shdmgr.ef_");

	// Step 2: Read raw bytes (no signature check)
	ReadFile(File, &Buffer, &Size);

	// Step 3: Parse PE/COFF headers
	DosHeader = (EFI_IMAGE_DOS_HEADER *)Buffer;
	PeHeader  = (EFI_IMAGE_NT_HEADERS *)(Buffer + DosHeader->e_lfanew);

	// Step 4: Allocate memory and copy sections
	ImageBase = AllocatePages(...);
	CopySections(ImageBase, Buffer, PeHeader);

	// Step 5: Apply base relocations from .reloc
	Delta = ImageBase - PeHeader->OptionalHeader.ImageBase;
	ApplyRelocations(ImageBase, PeHeader, Delta);

	// Step 6: Jump to entry point
	//         NO SIGNATURE VERIFICATION ANYWHERE
	EntryPoint = ImageBase + PeHeader->OptionalHeader.AddressOfEntryPoint;
	((EFI_IMAGE_ENTRY_POINT)EntryPoint)(ImageHandle, SystemTable);
}

LoadImage vs Custom Loader

The difference between the firmware's LoadImage() and the custom loader is the critical security gap:

root@kitploit:~
┌─────────────────────────────────────────────────────────────────────────┐
│  Firmware LoadImage() - How legitimate boot chains work                 │
│                                                                         │
│  bootx64.efi ──> LoadImage("shdmgr.ef_")                                │
│                      │                                                  │
│                      ├── Parse PE/COFF headers                          │
│                      ├── Verify Authenticode signature                  │
│                      ├── Check signature against db (allowed)           │
│                      ├── Check hash against dbx (revoked)               │
│                      ├── Call gSecurity2->FileAuthenticationState()     │
│                      │       │                                          │
│                      │       ├── Signature valid? ── YES ──> Load image │
│                      │       └── Signature invalid? ── NO ──> REJECT    │
│                      └── StartImage()                                   │
│                                                                         │
├─────────────────────────────────────────────────────────────────────────┤
│  Custom PE Loader - What shdloader.efi does                             │
│                                                                         │
│  shdloader.efi ──> OpenFile("shdmgr.ef_")                               │
│                      │                                                  │
│                      ├── ReadFile() into buffer                         │
│                      ├── Parse PE/COFF headers                          │
│                      ├── Allocate memory                                │
│                      ├── Copy sections                                  │
│                      ├── Apply .reloc relocations                       │
│                      ├── *** NO SIGNATURE CHECK ***                     │
│                      └── Jump to EntryPoint                             │
│                                                                         │
│  Result: ANY valid PE/COFF EFI application runs, signed or not          │
└─────────────────────────────────────────────────────────────────────────┘

PE/COFF Compatibility Requirements

The custom PE loader is a simplified implementation and expects a specific PE/COFF layout. Binaries that do not conform are rejected with errors:

root@kitploit:~
Reloc table overflows binary
Relocation failed
Invalid entry point

A binary missing any of these will be rejected by the custom loader.

FieldRequired ValueReason
Machine0x8664 (x64)The loader only supports x86-64 images
Subsystem10 (EFI Application)Must be an EFI Application
.reloc section.reloc must exist with valid base relocation entriesThe loader performs its own image relocation. Without .reloc, it fails with "Reloc table overflows binary"
Relocation DirectoryVirtualAddress != 0, Size != 0 (DATA_DIRECTORY[5])The directory entry must point to valid relocation data

A verification script (Scripts/VerifyPE.py) is provided to check compatibility before deployment.


Parallel with Kernel BYOVD

The structural parallel between UEFI BYOVUA and kernel BYOVD is exact, though CVE-2022-34302 represents the most direct form - the signed component itself loads unsigned code, rather than providing a primitive to disable verification:

root@kitploit:~
┌──────────────────────────────────────────────────────────────┐
│  UEFI BYOVUA - CVE-2022-34302 (Custom PE Loader)             │
│                                                              │
│  Signed Bootloader ──> Custom PE Loader ──> Load unsigned    │
│  (trusted by            (no sig check)       UEFI apps       │
│   Secure Boot)                                               │
├──────────────────────────────────────────────────────────────┤
│  UEFI BYOVUA - CVE-2022-34301/34303 (Shell + gSecurity2)     │
│                                                              │
│  Signed Shell ─ mm ─> gSecurity2 = NULL ─> Load unsigned     │
│  (trusted by          (Security2 Protocol)   UEFI apps       │
│   Secure Boot)                                               │
├──────────────────────────────────────────────────────────────┤
│  Kernel BYOVD (DSE Bypass)                                   │
│                                                              │
│  Signed Driver ─ IOCTL ─> g_CiOptions = 0 ─> Load unsigned   │
│  (trusted by              (CI.dll)            kernel drivers │
│   DSE / CI)                                                  │
└──────────────────────────────────────────────────────────────┘

CVE-2022-34302 is the most dangerous variant because the bypass is inherent to the bootloader's design - there is no intermediate step where the attacker needs to corrupt a security mechanism. The signed component directly loads unsigned code as its normal operation.




How It Works


Phase 1 - Boot the Signed Bootloader

The signed shdloader.efi is placed on the EFI System Partition (ESP) as the default boot loader. Because it is signed by Microsoft's UEFI Driver Publisher certificate, Secure Boot validates and loads it without issue.

root@kitploit:~
EFI System Partition (ESP)
└── EFI/
    └── Boot/
        └── bootx64.efi (shdloader.efi)   ← Signed by Microsoft Windows UEFI Driver Publisher
        └── shdmgr.ef_ (PAYLOAD)          ← Unsigned, loaded by shdloader's custom PE loader

When the system boots, the firmware:

  1. Reads bootx64.efi from the ESP
  2. Calls LoadImage() which verifies the Authenticode signature against the Secure Boot database
  3. Signature matches the Microsoft UEFI CA 2011 certificate in the db → image is accepted
  4. Calls StartImage() to transfer execution to shdloader.efi

Phase 2 - Custom PE Loader Activates

Once shdloader.efi has control, it prints a diagnostic message and immediately activates its custom PE/COFF loader:

root@kitploit:~
Booting in insecure mode

The bootloader then:

  1. Opens \EFI\Boot\shdmgr.ef_ using the filesystem protocol
  2. Reads the entire file into a memory buffer
  3. Parses the PE/COFF headers to extract section layout and relocation data
  4. Allocates executable memory at an arbitrary physical address
  5. Copies each PE section (.text, .data, .reloc, etc.) to the allocated memory
  6. Calculates the relocation delta (LoadAddress - ImageBase) and applies all base relocations from the .reloc section
  7. Resolves LoadAddress + AddressOfEntryPoint as the execution target

No signature verification occurs at any point in this process. The loader does not call LoadImage(), does not invoke gSecurity2->FileAuthenticationState(), and does not check the db or dbx databases. The file is loaded purely based on structural validity.

If the file is not found, the bootloader reports:

root@kitploit:~
Failed to open \EFI\Boot\shdmgr.ef_ - 800000000000000E
Failed to load image

Phase 3 - Unsigned Code Execution

The custom loader jumps to the entry point of shdmgr.ef_. The unsigned UEFI application now runs with:

  • Full hardware access (direct memory, I/O ports, PCI, MMIO)
  • No operating system loaded yet
  • No ASLR, DEP, or kernel protections
  • No EDR or endpoint security monitoring
  • Secure Boot reporting as enabled to any subsequent OS query

The attack is completely silent. Unlike CVE-2022-34301 and CVE-2022-34303, which display a visible UEFI Shell prompt, this exploit produces no visual output beyond the "Booting in insecure mode" message (which, on a legitimate system, appears briefly and is quickly replaced by the OS boot screen). On headless systems (servers, IoT, industrial equipment), there is no indication whatsoever.


Phase 4 - Persistence

The attack is persistent by default. As long as shdloader.efi remains at \EFI\Boot\bootx64.efi and the attacker's payload remains at \EFI\Boot\shdmgr.ef_ on the ESP, the unsigned payload executes on every boot.

No startup.nsh script is needed. No gSecurity2 address needs to be recalculated across firmware updates. The custom PE loader loads whatever shdmgr.ef_ it finds, unconditionally.

The system continues to report Secure Boot as "enabled" - only the trust chain has been broken at the bootloader level. This makes the attack invisible to OS-level Secure Boot status queries and to any security software that relies on Secure Boot attestation.

Important: Persistence is broken only if the DBX is updated with the revocation entry for shdloader.efi (KB5012170), which causes the firmware to reject shdloader.efi itself before the custom loader ever activates.




Exploit

The Exploit/ directory contains everything needed to build a compatible shdmgr.ef_:

root@kitploit:~
Exploit/
|
├── README.md                           ← Build guide and PE/COFF requirements
|
├── PayloadShdmgr/
|   |
│   ├── ForceReloc.nasm                 ← Force .reloc section generation
│   ├── shdmgr.ef_.c                    ← UEFI application source (EDK2)
│   ├── shdmgr.ef_.inf                  ← EDK2 module definition
│   ├── shdmgr.ef_.dsc                  ← EDK2 platform build configuration
│   └── shdmgr.ef_.dec                  ← EDK2 package declaration
|
└── Scripts/
    └── VerifyPE.py                    ← PE/COFF compatibility verifier



Lab Setup

DBX (Forbidden Signature Database)

The signed bootloader has been added to Microsoft's DBX revocation list via KB5012170 (August 2022). On updated systems, the bootloader will be rejected by Secure Boot before the custom PE loader ever activates.

For the lab environment, you need a system where:

  • The DBX has not been updated with the revocation entry for this specific bootloader
  • Or the DBX is empty (fresh VM with default Secure Boot keys)
  • Or you use a QEMU/OVMF environment with custom Secure Boot key enrollment

The QEMU UEFI Research Environment provides an automated setup for this.

Comparison with Shell-based CVEs

CVE-2022-34302 is simpler to exploit than CVE-2022-34301 and CVE-2022-34303:

AspectCVE-2022-34302 (Custom Loader)CVE-2022-34301/34303 (Shell)
TechniqueReplace shdmgr.ef_ with payloadCorrupt gSecurity2 via mm command
InteractionNone (fully automatic)Manual shell commands or startup.nsh
VisibilitySilent ("Booting in insecure mode")Visible UEFI Shell prompt
Firmware dependencyNone (payload is self-contained)gSecurity2 address changes per firmware build
ComplexityLow (file replacement)Medium (memory scanning and patching)
StealthHigh (no visual output on headless)Low (shell visible on screen)



References

Directly Related

  • Awesome Bring Your Own Vulnerable UEFI Application - Curated collection of known vulnerable signed UEFI applications

Eclypsium Research

  • One Bootloader to Load Them All - Original Eclypsium research disclosing CVE-2022-34301, CVE-2022-34302, CVE-2022-34303
  • DEF CON 30 - One Bootloader to Load Them All - Mickey Shkatov and Jesse Michael's presentation

Vendor

  • New Horizon Datasys (Horizon DataSys) - Vendor of Reboot Restore Rx and RollBack Rx
  • Reboot Restore Rx Pro v12 Release Notes - Documents the redesigned pre-OS EFI bootloader and new code signing certificate

UEFI Specifications

  • UEFI Specification - LoadImage() - Firmware boot service that enforces Secure Boot verification
  • UEFI PI Specification - Security Architectural Protocols - Official definition of the Security2 Architectural Protocol bypassed by the custom loader

Advisories

  • CERT/CC - VU#309662
  • NVD - CVE-2022-34302

Bootloader Catalog

  • Bootloaders.io - shdloader.efi - YARA rules, Sigma detections, and sample hashes for the revoked New Horizon Datasys bootloader

Related Techniques

  • CVE-2022-34301 - Eurosoft signed UEFI Shell bypass (esdiags.efi)
  • CVE-2022-34303 - CryptoPro Secure Disk signed UEFI Shell bypass (Shell_Full.efi)
  • CVE-2024-7344 - Howyar SysReturn signed bootloader with custom PE loader (similar technique to CVE-2022-34302)