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.

engine/classes/ElggPluginManifestParser18.php (1 issue)

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
 * Plugin manifest.xml parser for Elgg 1.8 and above.
4
 *
5
 * @package    Elgg.Core
6
 * @subpackage Plugins
7
 * @since      1.8
8
 */
9
class ElggPluginManifestParser18 extends \ElggPluginManifestParser {
10
	/**
11
	 * The valid top level attributes and defaults for a 1.8 manifest array.
12
	 *
13
	 * @var array
14
	 */
15
	protected $validAttributes = array(
16
		'name',
17
		'author',
18
		'version',
19
		'blurb',
20
		'description',
21
		'id',
22
		'website',
23
		'copyright',
24
		'license',
25
		'requires',
26
		'suggests',
27
		'screenshot',
28
		'contributor',
29
		'category',
30
		'conflicts',
31
		'provides',
32
		'activate_on_install',
33
		'repository',
34
		'bugtracker',
35
		'donations',
36
	);
37
38
	/**
39
	 * Required attributes for a valid 1.8 manifest
40
	 *
41
	 * @var array
42
	 */
43
	protected $requiredAttributes = array(
44
		'name', 'author', 'version', 'description', 'requires'
45
	);
46
47
	/**
48
	 * Parse a manifest object from 1.8 and later
49
	 *
50
	 * @return bool
51
	 *
52
	 * @throws PluginException
53
	 */
54
	public function parse() {
55
		$parsed = array();
56
		foreach ($this->manifestObject->children as $element) {
57
			switch ($element->name) {
58
				// single elements
59
				case 'blurb':
60
				case 'description':
61
				case 'name':
62
				case 'author':
63
				case 'version':
64
				case 'id':
65
				case 'website':
66
				case 'copyright':
67
				case 'license':
68
				case 'repository':
69
				case 'bugtracker':
70
				case 'donations':
71
				case 'activate_on_install':
72
					$parsed[$element->name] = $element->content;
73
					break;
74
75
				// arrays
76
				case 'category':
77
					$parsed[$element->name][] = $element->content;
78
					break;
79
80
				// 3d arrays
81
				case 'screenshot':
82
				case 'contributor':
83
				case 'provides':
84
				case 'conflicts':
85
				case 'requires':
86
				case 'suggests':
87
					if (!isset($element->children)) {
88
						return false;
89
					}
90
91
					$info = array();
92
					foreach ($element->children as $child_element) {
93
						$info[$child_element->name] = $child_element->content;
94
					}
95
96
					$parsed[$element->name][] = $info;
97
					break;
98
			}
99
		}
100
101
		// check we have all the required fields
102
		foreach ($this->requiredAttributes as $attr) {
103
			if (!array_key_exists($attr, $parsed)) {
104
				throw new \PluginException(_elgg_services()->translator->translate('PluginException:ParserErrorMissingRequiredAttribute',
105
							array($attr, $this->caller->getPluginID())));
106
			}
107
		}
108
109
		$this->manifest = $parsed;
110
111
		if (!$this->manifest) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $this->manifest of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using empty($expr) instead to make it clear that you intend to check for an array without elements.

This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.

Consider making the comparison explicit by using empty(..) or ! empty(...) instead.

Loading history...
112
			return false;
113
		}
114
115
		return true;
116
	}
117
}
118