From a004266b7c0acfacf9d544fb3930c11db3a8283c Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 20 Mar 2013 08:43:54 +0100 Subject: Check if the installed PHP version has a fix for the nullbyte vulnerability --- core/setup.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core') diff --git a/core/setup.php b/core/setup.php index 77eed5376d6..b61590e9e4b 100644 --- a/core/setup.php +++ b/core/setup.php @@ -18,6 +18,10 @@ $hasPostgreSQL = is_callable('pg_connect'); $hasOracle = is_callable('oci_connect'); $hasMSSQL = is_callable('sqlsrv_connect'); $datadir = OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data'); +$vulnerableToNullByte = false; +if(file_exists(__FILE__."\0Nullbyte")) { // Check if the used PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243) + $vulnerableToNullByte = true; +} // Protect data directory here, so we can test if the protection is working OC_Setup::protectDataDirectory(); @@ -31,6 +35,7 @@ $opts = array( 'directory' => $datadir, 'secureRNG' => OC_Util::secureRNG_available(), 'htaccessWorking' => OC_Util::ishtaccessworking(), + 'vulnerableToNullByte' => $vulnerableToNullByte, 'errors' => array(), ); -- cgit v1.2.3 From d4a492d321a20b7313434cb70e307f5e84f60726 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 20 Mar 2013 08:44:33 +0100 Subject: Show a warning in the installer if the used PHP version is vulnerable to the NULL Byte attack --- core/templates/installation.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'core') diff --git a/core/templates/installation.php b/core/templates/installation.php index 842686932c7..c70903cba55 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -19,6 +19,13 @@ + +
+ t('Security Warning'));?> +

t('Your PHP version is vulnerable to the NULL Byte attack (CVE-2006-7243)'));?>
+ t('Please update your PHP installation to use ownCloud securely.'));?>

+
+
t('Security Warning'));?> -- cgit v1.2.3