4.12.19 Miscellaneous Config - removing current working directory from root's PATH

Information

This change removes any '.' or '::' entries from the root PATH. If a '.' or '::' is present the current working directory is included in the search path.

Any '.' and '::' will be removed from the root PATH. This means that any harmful programs placed in common PATH locations, would never be automatically executed. All directories must be explicitly defined within the PATH variable.

Solution

Examine root's PATH to see if it contains any '.' or '::' entries-

su - root -c 'echo ${PATH}' |awk '/((:[ t]*:)|(:[ t]*$)|(^[ t]*:)|(^.:)|(:.$)|(:.:))/'

If the command above yields output, remove the '.' and '::' entries from the relevant initialization files. The files to examine are dependant on the root users shell definition in /etc/passwd. Once the file or files have been identified remove the '.' and '::' from the PATH variable0

vi <filename>

See Also

https://workbench.cisecurity.org/files/528