1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2026-07-06 13:08:00 -05:00
Files
VeraCrypt/src/Platform
damianrickard 3e231010dc macOS: search system directories before /usr/local/bin for binaries (#1790)
On macOS, Process::FindSystemBinary() searched /usr/local/bin first, so a
user-writable /usr/local/bin (the default on Homebrew installs) could
shadow system tools.

This resolver is also used to locate privileged binaries during privilege
elevation: CoreService.cpp resolves "sudo" (and "true") through it both
when probing for an active sudo session and when launching the elevated
helper, and the admin password is written to that sudo process's stdin.
On a typical Homebrew install /usr/local is owned by the (non-root) user,
so a planted /usr/local/bin/sudo would be selected ahead of /usr/bin/sudo
and could capture the admin password, leading to privilege escalation.

Reorder the macOS list to {/usr/bin, /bin, /usr/sbin, /sbin,
/usr/local/bin} so system locations always win. The binaries actually
resolved through this function on macOS (sudo, true, fsck, the terminal
helper used for filesystem checks and its dependencies, and non-APFS
formatters) live in system directories, so /usr/local/bin is kept only as
a last-resort fallback and can no longer shadow them. (diskutil, hdiutil
and newfs_apfs are invoked via absolute paths and were never affected.)

Co-authored-by: Damian Rickard <damian@rickard.us>
2026-06-22 09:05:29 +09:00
..
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00
2026-06-09 09:56:25 +09:00