mirror of
https://github.com/docker/docker-agent.git
synced 2026-11-06 15:07:58 +00:00
Introduce pkg/shellpath to centralize safe shell binary resolution: - WindowsCmdExe() resolves cmd.exe via ComSpec or %SystemRoot%\System32 instead of bare PATH lookup - DetectShell()/DetectWindowsShell() use exec.LookPath (absolute paths) for PowerShell, falling back to WindowsCmdExe() Replace vulnerable bare cmd.exe resolution in three critical locations: - pkg/tools/builtin/shell.go (detectShell) - pkg/hooks/executor.go (initShell) - pkg/tui/handlers.go (startShell) Fix TOCTOU race in credential providers: - lookupBinary() now returns the resolved absolute path - KeychainProvider and PassProvider store and reuse the resolved path instead of re-resolving bare binary names at invocation time Assisted-By: docker-agent