Bounty
XE-0677 · Bounty

[VM/High] TOCTOU race in DevTargetManager.SpawnSession — shells survive lease teardown

Closed · duplicate —claimed High web filed 2026-11-05 11:28 UTC by Ashev Ardiansyah

Report

Summary

vm/dev_target.go:61-89: SpawnSession reads target status under RLock, releases it, then checks status and spawns bash. Between RUnlock and exec.Command, Teardown can acquire write lock, change status to stopped, and delete target. SpawnSession proceeds anyway.

Impact

Shells survive lease teardown — the goroutine keeps bash alive indefinitely with no lifecycle management. Orphaned shells accumulate consuming host resources.

Fix

Hold write lock for entire SpawnSession critical section, or use a lease-scoped context that Teardown cancels.

Thread

Joseph Denneteam2026-11-05 22:19 UTCdesk

Thanks. This is the same finding as https://bounty.xe.network/XE-0659, 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, reply with what differs and we will look again.