Carding Forum
Professional
- Messages
- 2,788
- Reaction score
- 1,176
- Points
- 113
Security researchers from Binarly have identified the ability to bypass the UEFI Secure Boot verification mode on more than 800 products released by Acer, Dell, Fujitsu, Gigabyte, HP, Intel, Lenovo and Supermicro. The problem was codenamed PKfail and is related to the use of an untrustworthy platform key (PK, Platform Key) in the firmware, generated by AMI (American Megatrends International) and supplied as a test example. The oldest firmware versions that used the test key were released in 2012, and the newest ones are dated June 2024. According to researchers, more than 10% of all tested firmware versions are affected.
The key parameters indicated that it was not trustworthy and should not be delivered in their products. It was assumed that this test key should be replaced with its own, but the manufacturers did not pay attention to the warning and used a standard shared key sent to all partners and customers of the AMI company in the final firmware.
The private part of the AMI test key required for creating digital signatures was made publicly available after information was leaked from one of the hardware manufacturers, whose employee mistakenly placed the code containing this key in the public repository on GitHub. The private key was placed in an encrypted file, which was encrypted using a simple 4-character password, which was easily found by brute force.
The platform key is used as the root of trust to authenticate the database with keys for Secure Boot. Obtaining the private part of the platform key compromises the entire chain of trust involved in verifying the validity of components of the loaded system . Knowing the platform key, you can bypass Secure Boot protection and organize substitution when loading your own components by manipulating the KEK (Key Exchange Key) key and the "db" (Signature Database) and "dbx" (Forbidden Signature Database). KEK is responsible for creating a chain of trust between the firmware and the operating system, "db" contains certificates and signatures for the bootloader and third-party UEFI components, and "dbx" includes revoked signatures of known malicious components.
To perform an attack, it is enough to generate new keys and certificates for the KEK and db, and then use the publicly available test key of the platform to upload the created KEK certificate to the UEFI firmware. After uploading a KEK certificate to the firmware, you can use the associated private key to upload a new certificate to the db database. After loading the db certificate, the associated private key can be used to authenticate the loaded EFI components.
To check the correctness of the platform key, just run the "efi-readvar-v PK" utility from the efitools package and make sure that the platform key is not a test key:
• Video:
The key parameters indicated that it was not trustworthy and should not be delivered in their products. It was assumed that this test key should be replaced with its own, but the manufacturers did not pay attention to the warning and used a standard shared key sent to all partners and customers of the AMI company in the final firmware.
The private part of the AMI test key required for creating digital signatures was made publicly available after information was leaked from one of the hardware manufacturers, whose employee mistakenly placed the code containing this key in the public repository on GitHub. The private key was placed in an encrypted file, which was encrypted using a simple 4-character password, which was easily found by brute force.
The platform key is used as the root of trust to authenticate the database with keys for Secure Boot. Obtaining the private part of the platform key compromises the entire chain of trust involved in verifying the validity of components of the loaded system . Knowing the platform key, you can bypass Secure Boot protection and organize substitution when loading your own components by manipulating the KEK (Key Exchange Key) key and the "db" (Signature Database) and "dbx" (Forbidden Signature Database). KEK is responsible for creating a chain of trust between the firmware and the operating system, "db" contains certificates and signatures for the bootloader and third-party UEFI components, and "dbx" includes revoked signatures of known malicious components.
To perform an attack, it is enough to generate new keys and certificates for the KEK and db, and then use the publicly available test key of the platform to upload the created KEK certificate to the UEFI firmware. After uploading a KEK certificate to the firmware, you can use the associated private key to upload a new certificate to the db database. After loading the db certificate, the associated private key can be used to authenticate the loaded EFI components.
openssl req -newkey rsa:4096 -nodes -keyout KEK.key -new -x509 -sha256 -days 3650 -subj "/CN=BRLY KEK/" -out KEK.crt
openssl req -newkey rsa:4096 -nodes -keyout db.key -new -x509 -sha256 -days 3650 -subj "/CN=BRLY db/" -out db.crt
efi-updatevar -a -c KEK.crt -k PK.key KEK
efi-updatevar -a -c db.crt -k KEK.key db
sbsign --key db.key --cert db.crt --output rogue.efi.signed rogue.efi
To check the correctness of the platform key, just run the "efi-readvar-v PK" utility from the efitools package and make sure that the platform key is not a test key:
efi-readvar -v PK
Variable PK, length 862
PK: List 0, type X509
Signature 0, size 834, owner 26dc4851-195f-4ae1-9a19-fbf883bbb35e
Subject:
CN=DO NOT TRUST - AMI Test PK
Issuer:
CN=DO NOT TRUST - AMI Test PK
• Video: