diff --git a/include/tests_php b/include/tests_php index 98e5abf6..c77e71b2 100644 --- a/include/tests_php +++ b/include/tests_php @@ -195,23 +195,22 @@ # # Test : PHP-2374 # Description : Check PHP enable_dl option - # Notes : Extend test to check all PHP files YYY + # Notes : Extend test to check all PHP files if [ ! "${PHPINIFILE}" = "" ]; then PREQS_MET="YES"; else PREQS_MET="NO"; fi Register --test-no PHP-2374 --preqs-met ${PREQS_MET} --weight L --network NO --description "Check PHP enable_dl option" if [ ${SKIPTEST} -eq 0 ]; then LogText "Test: Checking PHP enable_dl option" - FIND=`egrep -i 'enable_dl.*(off|no|0)' ${PHPINIFILE} | grep -v '^;'` - if [ "${FIND}" = "" ]; then + FIND=$(egrep -i 'enable_dl.*(on|yes|1)' ${PHPINIFILE} | grep -v '^;') + if [ ! -z "${FIND}" ]; then Display --indent 4 --text "- Checking enable_dl option" --result "${STATUS_ON}" --color YELLOW - Report "Result: enable_dl option is turned on, which can be used for riskful downloads via PHP" - ReportSuggestion ${TEST_NO} "Change the enable_dl line to: enable_dl = Off, to disable downloads via PHP" + Report "Result: enable_dl option is turned on, which can be used to enable more modules dynamically and circumventing security controls" + ReportSuggestion ${TEST_NO} "Change the enable_dl line to: enable_dl = Off, to disable dynamically loading new modules" AddHP 0 1 else Display --indent 4 --text "- Checking enable_dl option" --result "${STATUS_OFF}" --color GREEN - LogText "Result: Found 'enable_dl' in disabled state (0, no, or off)" + LogText "Result: Found 'enable_dl' in disabled state (not present, 0, no, or off)" AddHP 2 2 fi - #YYY Check through all files fi # #################################################################################