The vulnerability, CVE-2023-43631, stems from a missing integrity check of the /config partition in the EVE OS boot process. An attacker with physical access could modify this partition to add their SSH public key, gaining root access because the change was not detected by the measured boot process.
The analysis of the patches reveals a two-part fix. The first part, in commit 5fef4d92e75838cc78010edaed5247dfbdae1889, introduces a new measurefs command to GRUB and modifies the boot script pkg/grub/rootfs.cfg. Specifically, the set_config_overrides function is updated to measure the /config partition into TPM PCR 13. This function is a critical part of the vulnerable process, as its prior version lacked this essential integrity check.
The second part of the fix, in commit aa3501d6c57206ced222c33aea15a9169d629141, updates the pillar application's TPM configuration. The DiskKeySealingPCRs variable in pkg/pillar/evetpm/tpm.go is modified to include PCR 13. This ensures that the disk encryption key is sealed against the measurement of the /config partition. Any function using this variable to unseal the key would now fail if the /config partition has been tampered with, preventing the system from booting and the SSH key from being used.
While the Go function that reads the malicious authorized_keys file is not directly visible in the patches, the set_config_overrides GRUB function is explicitly shown and is the point where the lack of integrity measurement occurs in the boot chain. Therefore, it is identified as a key function in the vulnerability.