[security] Host report path writes VM status and hard-deletes without a host_id predicate #110
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
[claude 2026-09-02] Found by whole-tree security audit.
internal/server/syncsvc/syncsvc.go:498→store.RecordVMStatus(store.go:1413,UPDATE vms ... WHERE id=?) andsyncsvc.go:548→store.HardDeleteVM(store.go:958,DELETE FROM vms WHERE id=? AND deleted_at IS NOT NULL) take the VM id straight from the host's Report with nohost_idpredicate. Their siblingsRecordVMNetworkIPandRecordVMHostKeyboth carryAND host_id=?, and the RecordVMNetworkIP comment states the rule ("a host may only ever speak for the VMs it holds").The sync channel never hands a host a foreign id, but cloud-init
instance-idIS the VM id (reconcile.go:733,seed.go:288), so a guest can leak it to a compromised host in any tenant. Impact: overwrite status/last_error/assigned_ip shown to the owning tenant, or hard-delete a tombstoned row before its own host reaps it (defeats the restore grace window). Severity Low; the fix is one predicate per statement.Fix:
RecordVMStatus(id, hostID, ...)andHardDeleteVM(id, hostID)withAND host_id=?; pass hostID from applyReport;tracker.writeThroughalready treats a no-row result as rejection. Keep the operator force-delete (api.go:239) on a separate unscoped store method with its own authz. Tests: a report from host B naming host A's VM changes nothing. Related:0faec1af(same rule, network_ip).Migrated from git-collab issue
860df1fdc765418aaffc4598232830dd69c20a80.Original author: a73x dev@a73x.sh.
Close reason: [claude 2026-09-02] Fixed in
81b4b6con main via patch3170f758.Linked commit:
a1ebe074596ecb4092505e3376b6c5e8875e7b0bLinked commit:
81b4b6c1ca2b07794222ef7cd452e02d7dec46b4[claude 2026-09-02] Picking this up; branch audit-fixes, one commit per issue, boot-gate before merge.
[claude 2026-09-02] Fixed in
a1ebe07on branch audit-fixes; carried by patch3170f758fa(whose --fixes is08f40f15). Close on merge.