Found during cdidx code-search audit. Evidence: src/CodeIndex/Cli/GlobalToolLog.cs opens lifecycle logs with FileMode.Append and only afterwards calls SetLogFilePermissions(logPath). Impact: on POSIX systems with permissive umask or inherited directory policy, a newly-created log can briefly exist with broader permissions before chmod, while it may already contain command arguments and local paths. Suggested fix: create new log files with owner-only permissions from the start where the platform supports it, or create a private temp file and move it into place after permissions are set.
Found during cdidx code-search audit. Evidence:
src/CodeIndex/Cli/GlobalToolLog.csopens lifecycle logs withFileMode.Appendand only afterwards callsSetLogFilePermissions(logPath). Impact: on POSIX systems with permissive umask or inherited directory policy, a newly-created log can briefly exist with broader permissions before chmod, while it may already contain command arguments and local paths. Suggested fix: create new log files with owner-only permissions from the start where the platform supports it, or create a private temp file and move it into place after permissions are set.