Provider VM State Deletion on Restart: cleanOrphans forcibly terminates and deletes all active consumer VMs on daemon startup
Report
Vulnerability Summary
In vm/lima_manager.go:325-347 (and similarly vm/qemu_manager.go:361-373), cleanOrphans() is invoked unconditionally during manager initialization (NewLimaManager, line 85):
func (m *LimaManager) cleanOrphans() {
out, err := m.runLimactl("list", "--json")
if err != nil {
return
}
for _, line := range strings.Split(strings.TrimSpace(out), "
") {
if line == "" {
continue
}
var entry struct {
Name string `json:"name"`
Status string `json:"status"`
}
if err := json.Unmarshal([]byte(line), &entry); err != nil {
continue
}
if strings.HasPrefix(entry.Name, "xe-") {
log.Printf("Cleaning orphaned Lima VM: %s (status: %s)", entry.Name, entry.Status)
_, _ = m.runLimactl("stop", entry.Name)
_, _ = m.runLimactl("delete", "--force", entry.Name)
}
}
}
When a provider node restarts (due to routine maintenance, OS update, or daemon reload), m.vms is initialized as an empty in-memory map. cleanOrphans() executes before any leases are reconciled or reloaded.
Because the manager does not maintain persistent on-disk state or cross-reference active on-chain leases (LeaseAccepted) from the ledger, it assumes that all existing VMs matching the xe- naming convention are orphans.
The daemon immediately issues limactl stop <name> and limactl delete --force <name>, forcibly terminating and permanently purging the virtual disks and environments of all active, paid consumer workloads.
Impact & Severity
- Total Workload Destruction: Every daemon restart or crash recovery completely deletes all running consumer virtual machines, destroying uncommitted customer data and in-flight computing jobs.
- Provider Slashing & Invalidation: On-chain leases remain active in
LeaseAcceptedstatus until settlement or expiration. Because the VM is destroyed, the provider can no longer pass attestation or performance proofs, resulting in consumer force-settlement and loss of provider stake.
Proposed Remediation
- Implement state persistence: Save active VM metadata (lease hash, ssh port, instance name) to a persistent manifest in
dataDir. - Reconcile on startup: During startup, cross-check existing instances against the ledger's active leases. Re-attach to healthy instances and populate
m.vmsinstead of deleting them. - Only purge VMs whose corresponding on-chain leases are confirmed terminated (
LeaseSettled,LeaseCancelled, orLeaseExpired).
Thread
Thanks. This is the same finding as https://bounty.xe.network/XE-0114, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-10006 and says what differs; it is read like any other.