Issues (2473)

Branch: master

Security Analysis    no vulnerabilities found

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

mod/maintenance/start.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
	
3
	function maintenance_init(){
4
		
5
		global $CONFIG;
6
		
7
		//	check if new walled garden setting is activated. If it is then our view core/account/login_walled_garden.php
8
		//	will take care of displaying our maintenance screen (see view default/core/account/login_walled_garden.php)
9
		
10
		if ( !$CONFIG->walled_garden ) {
11
			
12
			//	walled garden is not active - so we check our setting and if we're in maintenance mode
13
			//	we register a plugin hook for the index page. Notice we set its priority to 200 to get us
14
			//	hooked before the custom index plugin. Otherwise we'd have to be installed and configured
15
			//	above the custom index plugin - which is a pain.
16
			
17
			if(get_plugin_setting("maintenance_active","maintenance")=="yes" && !isadminloggedin()){
18
				
19
				elgg_register_plugin_hook_handler('index','system','maintenance_index',200);
20
				
21
				global $CONFIG;
22
				//	these are the lines that changed to make the plugin compatible with elgg installed in a sub
23
				//	directory. Author unknown.
24
				
25
				$base_uri = parse_url($CONFIG->wwwroot, PHP_URL_PATH);
26
				if($_SERVER["REQUEST_URI"] != $base_uri && $_SERVER["REQUEST_URI"] != "${base_uri}action/login"){
27
					
28
					admin_gatekeeper();
29
				}
30
			}
31
		}
32
	}
33
	
34
	function maintenance_index() {
35
		
36
		//	notice that this plugin does not check the return value sent in with the hook. If another plugin already hook system index
37
		//	then we just doubled up and hooked it too. This causes both pages to be displayed.
38
		
39
		//	the custom index plugin checks the value and returns if the page is already hooked.
40
		//	the code is:
41
		
42
		//	function custom_index($hook, $type, $return, $params) {
43
		//		if ($return == true) {
44
		// 			another hook has already replaced the front page
45
		//			return $return;
46
		//		}
47
		//		...
48
		//	}
49
		
50
		if (!include_once(dirname(__FILE__) . "/index.php")) {
51
			return false;
52
		}
53
54
		// return true to signify that we have handled the front page
55
		return true;
56
	}
57
	
58
	// Initialise plugin
59
	elgg_register_event_handler('init','system','maintenance_init');
60
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
61