Host-controlled EFI variables reach PID 1 when Secure Boot is off (if rtmr0 is not measured)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 22/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- linux
- Ambito
- operating-systems, security
Direzione di ricerca
The likely change point is shared/kernel/config.d/01-sane-defaults at line 20, where CONFIG_EFIVAR_FS=y is set, but the fix choice is undecided among three options. Read the reproduction steps and try to reproduce the SystemdOptions behaviour under QEMU with Secure Boot off. Done means a maintainer-agreed mitigation with verified boot output and a check that RTMR0 is the only measurement that changes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Was trying to learn and figure out what kinds of attacks are possible if RTMR0 is not measured, since verifying at runtime on gcp (like attested-tls currently does) requires downloading the 2MiB firmware from a gcp endpoint, which is something we'd like to optionally avoid for browser clients that are on mobile or bad connections.
Came up with this vulnerability, and so wondering if the CONFIG_EFIVAR_FS=y setting was actually desired, or just a copy-pasted debian default. See options below for different ways to fix this, which would be desirable for us.
Claude Summary
Summary
With Secure Boot off, systemd (PID 1) reads the SystemdOptions EFI variable and merges it into its own command line. In a TDX guest the variable store is supplied by the host and measured into RTMR0, not into MRTD, RTMR1 or RTMR2. So a malicious host can inject systemd manager options into an otherwise-pinned image, and an attestation that checks only MRTD/RTMR1/RTMR2 (or MRTD + a fixed firmware endorsement) will not see the change.
Impact
TDX's threat model treats the host as untrusted. The firmware's variable store is a host input, measured into RTMR0. Because systemd acts on it:
- systemd.setenv=K=V injects environment variables into every service PID 1 spawns.
- systemd.mask= / systemd.wants= / systemd.unit= change what runs.
- systemd.debug_shell= starts a root shell if debug-shell.service ships.
None of this changes MRTD, RTMR1 or RTMR2. A verifier that does not check RTMR0 admits the tampered guest. The same gap lets a founding/attestation archive replay cleanly.
Reproduction (QEMU, Secure Boot off, as in the repo's documented boot)
- Boot the firmware alone to the UEFI shell and set the variable into the (host-controlled) variable store:
setvar SystemdOptions -guid 8cf2644b-4b0b-428f-9387-6d876050dc67 -bs -rt -nv =L"systemd.log_level=debug systemd.log_target=console" - Boot the image (-kernel ) with that variable store.
- The boot fills with systemd DEBUG output: PID 1 applied an option from the host-controlled EFI variable. MRTD/RTMR1/RTMR2 are unchanged; only RTMR0 differs.
(log_level is used because it needs no extra units and proves PID 1 itself honors the variable. debug_shell depends on debug-shell.service being present.)
Affected versions
- systemd ≤ 257 reads SystemdOptions whenever Secure Boot is off (src/basic/efivars.c, guarded only by is_efi_secure_boot()). The Debian trixie base ships systemd 257.
- systemd 258 removed SystemdOptions support entirely, which closes this specific route.
Options to fix
- Disable efivarfs in the kernel config (CONFIG_EFIVAR_FS=n). This closes the whole class of host→guest EFI-variable channels, not just SystemdOptions. It also disables boot-loader variable features (bootctl, systemd-bless-boot/boot assessment, Loader* reads), so only fits images that don't use them.
- Move to systemd 258+, which drops SystemdOptions. Narrower: other firmware-sourced inputs may still be read.
- Boot with Secure Boot on, which systemd already treats as a reason to ignore the variable.
Note on the current config
shared/kernel/config.d/01-sane-defaults:20 sets CONFIG_EFIVAR_FS=y. If that's an inherited default rather than a needed feature, disabling it for the confidential-VM images is the simplest mitigation. If boot assessment or bootctl is in use, one of the other options fits better.
- Lingua principale
- Shell
- Stelle
- 26
- Fork
- 18
- Merge medio
- 2g 8h
- PR unite (30g)
- 17
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di flashbots/flashbots-images
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
flashbots/flashbots-images#246 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
flashbots/flashbots-images#229 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
flashbots/flashbots-images#99 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
flashbots/flashbots-images#96 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di flashbots/flashbots-images
Issue simili
-
26.04 bug dark-mode Easy Hack impress symptom: visual
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CollaboraOnline/online#16421 · 1 commento ·
-
Pin Python to 3.14 in the era5grib-parallel environment specificationForse già presa @atteggiani l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
ACCESS-NRI/containerised-environments-infra#129 ·
I maintainer di solito rispondono entro 2 giorni
-
priority middle
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
KATO-Hiro/AtCoderClans#13029 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
melodic-software/claude-code-plugins#17039 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug version-D
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100