Issues (51)

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.

SemanticMaps.hooks.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
use SMW\DataTypeRegistry;
4
5
/**
6
 * Static class for hooks handled by the Semantic Maps extension.
7
 *
8
 * @since 0.7
9
 *
10
 * @ingroup SemanticMaps
11
 *
12
 * @licence GNU GPL v2+
13
 * @author Jeroen De Dauw < [email protected] >
14
 */
15
final class SemanticMapsHooks {
16
17
	/**
18
	 * Adds a link to Admin Links page.
19
	 *
20
	 * @since 0.7
21
	 *
22
	 * @param ALTree $admin_links_tree
23
	 *
24
	 * @return boolean
25
	 */
26
	public static function addToAdminLinks( ALTree &$admin_links_tree ) {
27
	    $displaying_data_section = $admin_links_tree->getSection( wfMessage( 'smw_adminlinks_displayingdata' )->text() );
28
29
	    // Escape if SMW hasn't added links.
30
	    if ( is_null( $displaying_data_section ) ) {
31
			return true;
32
		}
33
34
	    $smw_docu_row = $displaying_data_section->getRow( 'smw' );
35
36
	    $sm_docu_label = wfMessage( 'adminlinks_documentation', 'Semantic Maps' )->text();
37
	    $smw_docu_row->addItem( AlItem::newFromExternalLink( 'http://mapping.referata.com/wiki/Semantic_Maps', $sm_docu_label ) );
38
39
	    return true;
40
	}
41
42
	/**
43
	 * Adds support for the geographical coordinates and shapes data type to Semantic MediaWiki.
44
	 *
45
	 * @since 2.0
46
	 *
47
	 * @return boolean
48
	 */
49
	public static function initGeoDataTypes() {
50
		DataTypeRegistry::getInstance()->registerDatatype(
51
			'_geo',
52
			SMGeoCoordsValue::class,
53
			SMWDataItem::TYPE_GEO
54
		);
55
56
		DataTypeRegistry::getInstance()->registerDatatype(
57
			'_gpo',
58
			SMGeoPolygonsValue::class,
59
			SMWDataItem::TYPE_BLOB
60
		);
61
62
		return true;
63
	}
64
65
	/**
66
	 * Set the default format to 'map' when the requested properties are
67
	 * of type geographic coordinates.
68
	 *
69
	 * TODO: have a setting to turn this off and have it off by default for #show
70
	 *
71
	 * @since 1.0
72
	 *
73
	 * @param $format Mixed: The format (string), or false when not set yet
74
	 * @param $printRequests Array: The print requests made
75
	 * @param $params Array: The parameters for the query printer
76
	 *
77
	 * @return boolean
78
	 */
79
	public static function addGeoCoordsDefaultFormat( &$format, array $printRequests, array $params ) {
0 ignored issues
show
The parameter $params is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
80
		// Only set the format when not set yet. This allows other extensions to override the Semantic Maps behavior.
81
		if ( $format === false ) {
82
			// Only apply when there is more then one print request.
83
			// This way requests comming from #show are ignored.
84
			if ( count( $printRequests ) > 1 ) {
85
				$allValid = true;
86
				$hasCoords = false;
87
88
				// Loop through the print requests to determine their types.
89
				foreach( $printRequests as /* SMWPrintRequest */ $printRequest ) {
90
					// Skip the first request, as it's the object.
91
					if ( $printRequest->getMode() == SMWPrintRequest::PRINT_THIS ) {
92
						continue;
93
					}
94
95
					$typeId = $printRequest->getTypeID();
96
97
					if ( $typeId == '_geo' ) {
98
						$hasCoords = true;
99
					}
100
					else {
101
						$allValid = false;
102
						break;
103
					}
104
				}
105
106
				// If they are all coordinates, set the result format to 'map'.
107
				if ( $allValid && $hasCoords ) {
108
					$format = 'map';
109
				}
110
			}
111
112
		}
113
114
		return true;
115
	}
116
117
}
118