The vulnerability is a classic race condition (CWE-362) where shared resources (the containers.json and browsers.json registry files) are modified without proper synchronization. The vulnerability description explicitly mentions that "Concurrent updateRegistry/removeRegistryEntry operations...could lose updates or resurrect removed entries under race conditions."
The analysis of the patch cc29be8c9 confirms this. The core change is the introduction of a locking mechanism (withRegistryLock) around the read-modify-write logic in four functions: updateRegistry, removeRegistryEntry, updateBrowserRegistry, and removeBrowserRegistryEntry.
Before the patch, these functions would read the entire registry file, modify their in-memory representation, and then write the entire file back to disk. If two processes did this at the same time, the process that writes last would overwrite the changes of the first, leading to data loss or inconsistency. For example, if one process adds an entry and another removes a different entry, the final state of the registry would depend on which process finished writing last, potentially losing one of the two changes.
The vulnerable functions are precisely these four exported functions from src/agents/sandbox/registry.ts, as they are the entry points for modifying the sandbox and browser registries. Any runtime profile or stack trace captured during the problematic concurrent operations would show calls to these functions. The patch also introduces atomic file writes (write-to-temp-and-rename) to prevent corruption from partial writes, further hardening the registry operations.