4.13 Remove 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.

Rationale:

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 variable

vi <filename>

Default Value:

Dot not present

See Also

https://workbench.cisecurity.org/benchmarks/13069

Item Details

Category: CONFIGURATION MANAGEMENT, SYSTEM AND SERVICES ACQUISITION

References: 800-53|CM-2, 800-53|CM-6, 800-53|CM-7, 800-53|CM-7(1), 800-53|CM-9, 800-53|SA-3, 800-53|SA-8, 800-53|SA-10, CSCv7|5.1

Plugin: Unix

Control ID: 9a981eb7afe57fd2db9b9c77f4f37cc1e2a240f2b102fa72e73d6bdaed8724e6