The vulnerability is a logical flaw in the TPM policy for LUKS disk encryption in IncusOS, identified as GHSA-wj2j-qwcf-cfcc. The system was configured to bind the LUKS encryption key to TPM PCRs 7 and 11 (and 4 if not using Secure Boot). This policy was insufficient because it allowed the TPM to release the encryption key even after the initial boot phase (initrd) had completed.
An attacker with physical access could exploit this by substituting the real root partition with a malicious one. The system would still boot with the correct Secure Boot and TPM state up to the end of the initrd, as the signed kernel image (UKI) was not modified. The attacker's malicious OS would then run, and because the TPM state was still considered 'good' under the vulnerable policy, a script on the attacker's OS could request the LUKS key for the original (now detached) root partition from the TPM, thus bypassing the disk encryption.
The fix, implemented in commit e3b35f230d23443d27752eac27ebb2b22c957b75, was to add a binding to PCR15. PCR15 is extended by systemd when the root LUKS volume is unlocked in the initrd. By binding the key to an uninitialized (all zeros) value of PCR15, the key can only be released by the TPM during the initrd phase. Once the root volume is unlocked, PCR15's value changes, and the TPM will no longer release the key. This prevents the attacker's OS, which runs after the initrd phase, from accessing the key.
The identified vulnerable functions are those that were responsible for creating the original, insecure TPM binding by calling systemd-cryptenroll without including the PCR15 binding. These functions were modified in the patch to include the +15:sha256=00...0 argument in the systemd-cryptenroll command. The main.startup function is also included as it's the high-level entry point that orchestrates this configuration on boot and is where the check for the vulnerable configuration is now performed.