Provide a way to prevent unconditional trust to built-in (vendor) certificate
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c
- Domain
- operating-systems, security
Research direction
The issue names no files or tests. Start by tracing shim's handling of built-in certificates, MokList, NVRAM variables, and SBAT, then determine where the proposed trust restriction belongs. Done means defining and implementing the variable behavior, including the alternative-certificate safeguard and required SBAT change.
Written by the indexing model from the issue text.
Description
Hi devs,
With ongoing adoption of UKIs it's now possible to build trust chain from UEFI firmware up to early userspace code driven by initrd/initramfs embedded into signed UKI. The approach is used to perform automatic TPM2-based LUKS device unlocking during initrd phase. TPM2 policies may be configured in a way to prevent automatic unlocking when unexpected boot code is involved but there is no way to prevent unexpected early userspace from being invoked (which may be used i.e. to spoof LUKS device password prompt).
Even if UKI is signed with a custom user key/cert there is still a possibility to run arbitrary unsigned initrd/initramfs code in conjunction with kernel signed by built-in (vendor) key/cert. The workflow is perfectly supported by shim-based setups due to legacy reasons.
The problem is that built-in cert cannot be un-enrolled to prevent unsigned initrd/initramfs workflow. Even if mokutil --delete is used against built-in cert, it's still populated into MokList and unconditionally trusted on next boot. Hence the proposal is to introduce NVRAM variable to prevent unconditional trust to the built-in certificate. Shim's SBAT Level have to be bumped in addition.
The approach may be considered too strict and soft-brick systems that do not have alternative certificates in MokList. Hence logic based on proposed NVRAM variable may check if there is alternative certificate enrolled into MokList.
P.S.: Other considered approaches:
-
Add built-in certificate to MokListX. It works to some extent. However given there are plenty of shim versions that carry certs for other vendors and distros, it's not easily manageable to track and block them all. Otherwise it's still possible to drop a shim + kernel from unblocked distro onto ESP.
-
Deploy custom PK and KEK. Looks like an overkill and not perfectly compatible approach due to multi-boot setups and Option ROMs.
- Dominant language
- C
- Stars
- 1.1k
- Forks
- 348
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rhboot/shim
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100