I just discovered that
PATH on CentOS does not include
What's the rationale for this? I'm tempted to add it to the
PATH but I don't know what vulnerabilities that might introduce.
Information Security Stack Exchange is a question and answer site for information security professionals. It only takes a minute to sign up.Sign up to join this community
There is a discussion here https://bugs.centos.org/view.php?id=5707 indicating inconsistent behavior. It's there via sudo but not there with a direct root login. That's according to the bug report, which is specific to centOS 6.
More to the point, you're vulnerable if there is danger of bad stuff being installed at /usr/local/bin. By forcing yourself to use the full path ( /usr/local/bin/whatever ) you don't have any risk of accidentally invoking bad stuff via $PATH.
Of course that's true for anything performed with elevated privilege. Keep your path variable limited and you reduce your risk of tripping over an intruder's trap.