The vulnerability exists in the BetaLocalFilesystemMemoryTool class, which failed to specify secure file permissions when creating files and directories. The tool relied on Node.js's default modes, which are 0o777 for directories and typically 0o666 for files. In environments with a permissive umask (e.g., 0o000, common in Docker containers), this resulted in world-readable and world-writable memory files and directories.
A local attacker could exploit this to either read sensitive agent state from the memory files or modify them to manipulate the agent's behavior. The vulnerability affected any function within the class that performed a file system write operation, including directory creation and file creation/modification.
The patch addresses this by explicitly setting secure modes (0o700 for directories and 0o600 for files) in all fs.mkdir and fs.open calls, restricting access to only the owner of the process. The identified vulnerable functions are the public methods in the BetaLocalFilesystemMemoryTool class that trigger these insecure file system operations.