<!-- XE-10006 · Provider VM State Deletion on Restart: cleanOrphans forcibly terminates and deletes all active consumer VMs on daemon startup · testnet -->
*Markdown view of <https://bounty.xe.network/XE-10006>. The page is the record; this is the same page for reading.*

XE-10006 · Bounty

# Provider VM State Deletion on Restart: cleanOrphans forcibly terminates and deletes all active consumer VMs on daemon startup

Closed · duplicate
—
web
filed 2026-11-12 09:05 UTC
by xe:e4cd6974

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   Node / API

Duplicate of
:   [XE-0114](https://bounty.xe.network/XE-0114) triaging

Tracked
:   —

Updated
:   2026-11-20 00:33 UTC

Told
:   2026-11-20 00:33 UTC

### Patches

None linked.

### History

- [552614](https://bounty.xe.network/log/552614) 2026-11-20 00:33 UTC proposal.adopted
- [552613](https://bounty.xe.network/log/552613) 2026-11-20 00:33 UTC reply.sent
- [552612](https://bounty.xe.network/log/552612) 2026-11-20 00:33 UTC ticket.status new → closed
- [552036](https://bounty.xe.network/log/552036) 2026-11-20 00:33 UTC proposal.adopted
- [552035](https://bounty.xe.network/log/552035) 2026-11-20 00:33 UTC ticket.facts area
- [552034](https://bounty.xe.network/log/552034) 2026-11-20 00:33 UTC proposal.adopted
- [552033](https://bounty.xe.network/log/552033) 2026-11-20 00:33 UTC ticket.facts
- [552032](https://bounty.xe.network/log/552032) 2026-11-20 00:33 UTC proposal.adopted
- [552031](https://bounty.xe.network/log/552031) 2026-11-20 00:33 UTC ticket.facts
- [550919](https://bounty.xe.network/log/550919) 2026-11-20 00:31 UTC note.added
- [550918](https://bounty.xe.network/log/550918) 2026-11-20 00:31 UTC proposal.created
- [550917](https://bounty.xe.network/log/550917) 2026-11-20 00:31 UTC proposal.created

[Full history](https://bounty.xe.network/log?ref=XE-10006) · [JSON](https://bounty.xe.network/v1/tickets/XE-10006) · [markdown](https://bounty.xe.network/XE-10006.md)

### 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

1. 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.
2. Provider Slashing \& Invalidation: On-chain leases remain active in `LeaseAccepted` status 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

1. Implement state persistence: Save active VM metadata (lease hash, ssh port, instance name) to a persistent manifest in `dataDir`.
2. Reconcile on startup: During startup, cross-check existing instances against the ledger's active leases. Re-attach to healthy instances and populate `m.vms` instead of deleting them.
3. Only purge VMs whose corresponding on-chain leases are confirmed terminated (`LeaseSettled`, `LeaseCancelled`, or `LeaseExpired`).

### Thread

**Joseph Denne**team2026-11-20 00:33 UTCdesk

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.
