Summary
We found an issue in our own confidential-computing product that also applies to Phala dstack.
systemd-gpt-auto-generator is a systemd service that reads the root disk's partition table (GPT) during boot and mounts partitions based on the information there. Under the confidential computing threat model that is an issue because it means that a partition the host appends to that table could be mounted or activated inside the guest.
Details
It supports policy which is by default set to image_policy_host, which accepts swap, home, srv, var and var/tmp. Note that an existing mount or fstab entry pre-empts a generated unit, so which ones take effect depends on the image.
And based on code review of your codebase:
- The command line is defined in
os/image/kernel-cmdline.sh and sets no parameter that would disable the generator.
- The image is Debian trixie, which ships the generator unmasked.
- Nothing removes the generator from the mkosi image: the
prod profile deletes systemd-getty-generator but not this one. Your legacy Yocto backend did delete it (systemd_%.bbappend), so the mkosi rewrite dropped that line.
dstack-mr measures the kernel, the initrd, the OVMF build and the command line. On GCP and AWS the table is measured into PCR 5, and the quotes select PCRs 0, 2, 14 and sha256(PCR4||PCR7||PCR12) respectively; we took the GCP selection from your issue #1296.
There are several ways to solve this, we suggest systemd.gpt_auto=0 on the measured command line, which every version since v252 parses the same way. systemd.image_policy= could also be used, with two things worth noting: image policies did not exist before v254, so older versions ignore the parameter silently and the generator carries on; and on v254 and v255 a bug makes setting it abort the generator. From v256 it works as documented.
We are happy to answer questions. We would like to see this fixed quickly, so we propose an embargo until 2026-11-12 at 14:00 UTC, when we plan to publish our advisory and our fix. This is not public: no advisory, CVE or public issue exists yet, and we have reported it privately only to a few other products we think are similarly affected. If that timing is a problem for you, tell us and we will coordinate.
Proof of concept
We have not run a full end to end exploit using your image, but we did boot your published image with a host-appended swap partition:
mkosi-os-v0.6.1 (dstack-0.6.1.tar.gz, os_image_hash ec43cb8c5e04b6bb6c53b33b16076a01d83d01f7f4b703f2f78a0d947d6247e6, which matches your digest.txt), booted in plain QEMU with the command line from its metadata.json and one swap-typed partition appended to the disk.
- The guest activated it 1.7 seconds into boot:
Adding 265192k swap on /dev/vda3, under a unit described as Swap Partition, which is the description systemd-gpt-auto-generator writes in add_partition_swap().
- The same image booted without that partition activates no swap.
Impact
Using this mechanism, we were able to construct primitives that allow a host to read and write confidential guest memory in our product, without affecting attestation, and we are reasonably certain that similar primitives could be constructed for yours. We consider this a high severity vulnerability. We found this in our own product on SEV-SNP hardware, though nothing in the mechanism depends on the TEE.
Patches
Fixed in guest OS 0.6.2 and later (0.6.3). The measured kernel command line now sets systemd.gpt_auto=0 systemd.import_credentials=no, and production images remove the systemd generators that act on host-controlled input.
Upgrade the guest OS, register the new os_image_hash on chain, and redeploy CVMs on the new image.
Summary
We found an issue in our own confidential-computing product that also applies to Phala dstack.
systemd-gpt-auto-generatoris a systemd service that reads the root disk's partition table (GPT) during boot and mounts partitions based on the information there. Under the confidential computing threat model that is an issue because it means that a partition the host appends to that table could be mounted or activated inside the guest.Details
It supports policy which is by default set to
image_policy_host, which accepts swap, home, srv, var and var/tmp. Note that an existing mount or fstab entry pre-empts a generated unit, so which ones take effect depends on the image.And based on code review of your codebase:
os/image/kernel-cmdline.shand sets no parameter that would disable the generator.prodprofile deletessystemd-getty-generatorbut not this one. Your legacy Yocto backend did delete it (systemd_%.bbappend), so the mkosi rewrite dropped that line.dstack-mrmeasures the kernel, the initrd, the OVMF build and the command line. On GCP and AWS the table is measured into PCR 5, and the quotes select PCRs 0, 2, 14 andsha256(PCR4||PCR7||PCR12)respectively; we took the GCP selection from your issue #1296.There are several ways to solve this, we suggest
systemd.gpt_auto=0on the measured command line, which every version since v252 parses the same way.systemd.image_policy=could also be used, with two things worth noting: image policies did not exist before v254, so older versions ignore the parameter silently and the generator carries on; and on v254 and v255 a bug makes setting it abort the generator. From v256 it works as documented.We are happy to answer questions. We would like to see this fixed quickly, so we propose an embargo until 2026-11-12 at 14:00 UTC, when we plan to publish our advisory and our fix. This is not public: no advisory, CVE or public issue exists yet, and we have reported it privately only to a few other products we think are similarly affected. If that timing is a problem for you, tell us and we will coordinate.
Proof of concept
We have not run a full end to end exploit using your image, but we did boot your published image with a host-appended swap partition:
mkosi-os-v0.6.1(dstack-0.6.1.tar.gz,os_image_hash ec43cb8c5e04b6bb6c53b33b16076a01d83d01f7f4b703f2f78a0d947d6247e6, which matches yourdigest.txt), booted in plain QEMU with the command line from itsmetadata.jsonand one swap-typed partition appended to the disk.Adding 265192k swap on /dev/vda3, under a unit described asSwap Partition, which is the descriptionsystemd-gpt-auto-generatorwrites inadd_partition_swap().Impact
Using this mechanism, we were able to construct primitives that allow a host to read and write confidential guest memory in our product, without affecting attestation, and we are reasonably certain that similar primitives could be constructed for yours. We consider this a high severity vulnerability. We found this in our own product on SEV-SNP hardware, though nothing in the mechanism depends on the TEE.
Patches
Fixed in guest OS 0.6.2 and later (0.6.3). The measured kernel command line now sets
systemd.gpt_auto=0 systemd.import_credentials=no, and production images remove the systemd generators that act on host-controlled input.Upgrade the guest OS, register the new
os_image_hashon chain, and redeploy CVMs on the new image.