Skip to content

Lifecycle log creation should avoid owner-only permission races #2843

Description

@Widthdom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsecurity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions