The vulnerability is a time-of-check to time-of-use (TOCTOU) race condition in the handling of the auth.json file, which stores sensitive credentials. The analysis of the patch commit 135fb545f99106a4a249274f129b90bc0a77d347 reveals that the file was being written with default system permissions first, and then its permissions were restricted to owner-only (0o600) in a separate step. This creates a small time window where a local attacker could potentially read the contents of auth.json before the permissions are tightened.
The patch addresses this by using the mode option in the writeFileSync call, ensuring the file is created with the correct restrictive permissions from the very beginning. The functions FileAuthStorageBackend.ensureFileExists, FileAuthStorageBackend.withLock, and FileAuthStorageBackend.withLockAsync in packages/coding-agent/src/core/auth-storage.ts were all identified as vulnerable because they performed this unsafe file writing operation. An attacker triggering this vulnerability would cause these functions to appear in a runtime profile.