Issues (49)

Security Analysis    no request data  

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.

ChangeNotification/NotificationGroupsLocator.php (2 issues)

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
namespace SMW\Notifications\ChangeNotification;
4
5
use SMW\Notifications\PropertyRegistry;
6
use SMW\ApplicationFactory;
7
use SMW\Notifications\DataValues\NotificationGroupValue;
8
use SMW\Store;
9
use SMW\DIProperty;
10
use SMWDIBlob as DIBlob;
11
use SMWDataItem as DataItem;
12
13
/**
14
 * @license GNU GPL v2+
15
 * @since 1.0
16
 *
17
 * @author mwjames
18
 */
19
class NotificationGroupsLocator {
20
21
	/**
22
	 * @var Store
23
	 */
24
	private $store;
25
26
	/**
27
	 * @since 1.0
28
	 *
29
	 * @param  Store $store
30
	 */
31 5
	public function __construct( Store $store ) {
32 5
		$this->store = $store;
33 5
	}
34
35
	/**
36
	 * Special group
37
	 *
38
	 * @since 1.0
39
	 *
40
	 * @return []
0 ignored issues
show
The doc-type [] could not be parsed: Unknown type name "" at position 0. [(view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
41
	 */
42 1
	public function getSpecialGroupOnSpecificationChange() {
43
		return array(
44 1
			NotificationGroupValue::SPECIAL_GROUP => array( new DIBlob( NotificationGroupValue::getSpecialGroupName() ) )
45
		);
46
	}
47
48
	/**
49
	 * @since 1.0
50
	 *
51
	 * @param DataItem $dataItem
52
	 * @param array $subSemanticDataMatch
53
	 *
54
	 * @return DataItem[]
55
	 */
56 2
	public function findNotificationsToGroupList( DataItem $dataItem, array $subSemanticDataMatch ) {
57
58 2
		$property = new DIProperty(
59 2
			PropertyRegistry::NOTIFICATIONS_TO_GROUP
60
		);
61
62
		// Either match the property on a plain assignment or
63 2
		if ( ( $pv = $this->store->getPropertyValues( $dataItem, $property ) ) !== array() ) {
64
			return $pv;
65
		}
66
67
		// Find out whether a detection matrix was build using a subobject
68 2
		$semanticData = $this->store->getSemanticData(
69 2
			$dataItem
0 ignored issues
show
$dataItem of type object<SMWDataItem> is not a sub-type of object<SMW\DIWikiPage>. It seems like you assume a child class of the class SMWDataItem to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
70
		);
71
72 2
		$propertyValues = array();
73
74
		// Get the group from the subobject that contained the matchable
75
		// condition from the preceding filterOnChange process
76 2
		foreach ( $subSemanticDataMatch as $hash => $value ) {
77 1
			foreach ( $value as $sobj ) {
78
				if (
79 1
					( $hash === $dataItem->getHash() ) &&
80 1
					( $subSemanticData = $semanticData->findSubSemanticData( $sobj ) ) !== array() ) {
81 1
					$propertyValues = array_merge( $propertyValues, $subSemanticData->getPropertyValues( $property ) );
82
				}
83
			}
84
		}
85
86 2
		return $propertyValues;
87
	}
88
89
	/**
90
	 * @since 1.0
91
	 *
92
	 * @param array $subSemanticDataMatch
93
	 *
94
	 * @return Closure
95
	 */
96
	public function getNotificationsToGroupListAsCallback( array $subSemanticDataMatch ) {
97 1
		return function( $dataItem ) use( $subSemanticDataMatch ) {
98
			return $this->findNotificationsToGroupList( $dataItem, $subSemanticDataMatch );
99 1
		};
100
	}
101
102
}
103