Created
October 4, 2015 05:40
-
-
Save forestbaker/58c16149f54ba98969aa to your computer and use it in GitHub Desktop.
precautions to take when running SUID/SGID scripts - mitigate risk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check if BASH_ENV is empty | |
set umask 077 | |
Reset $PATH and $IFS | |
ALWAYS - use absolute path names | |
Check return codes from system utilities. | |
Signify the end of the option list with -- | |
Quote all command line parameters (e.g. "$1") | |
Check user input for shell metacharacters and garbage | |
Check user supplied pathnames (absolute/relative) | |
set shell option noclobber to avoid overwriting existing files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment