Re:Understanding the bin, sbin, usr/bin, usr/sbin split (2010)
by rascul on Wednesday May 11, 2022 @08:49AM
(#31339182)
The fix is for the user to use a smaller $PATH when possible. Any method of checking that the command exists and is executable before trying to execute it leads to TOCTOU race conditions.
https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use