Issues (4122)

Security Analysis    not enabled

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.

maintenance/eval.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
 * This script lets a command-line user start up the wiki engine and then poke
4
 * about by issuing PHP commands directly.
5
 *
6
 * Unlike eg Python, you need to use a 'return' statement explicitly for the
7
 * interactive shell to print out the value of the expression. Multiple lines
8
 * are evaluated separately, so blocks need to be input without a line break.
9
 * Fatal errors such as use of undeclared functions can kill the shell.
10
 *
11
 * To get decent line editing behavior, you should compile PHP with support
12
 * for GNU readline (pass --with-readline to configure).
13
 *
14
 * This program is free software; you can redistribute it and/or modify
15
 * it under the terms of the GNU General Public License as published by
16
 * the Free Software Foundation; either version 2 of the License, or
17
 * (at your option) any later version.
18
 *
19
 * This program is distributed in the hope that it will be useful,
20
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
 * GNU General Public License for more details.
23
 *
24
 * You should have received a copy of the GNU General Public License along
25
 * with this program; if not, write to the Free Software Foundation, Inc.,
26
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27
 * http://www.gnu.org/copyleft/gpl.html
28
 *
29
 * @file
30
 * @ingroup Maintenance
31
 */
32
33
$optionsWithArgs = [ 'd' ];
34
35
/** */
36
require_once __DIR__ . "/commandLine.inc";
37
38
if ( isset( $options['d'] ) ) {
39
	$d = $options['d'];
40
	if ( $d > 0 ) {
41
		$wgDebugLogFile = '/dev/stdout';
42
	}
43
	if ( $d > 1 ) {
44
		$lb = wfGetLB();
45
		$serverCount = $lb->getServerCount();
46
		for ( $i = 0; $i < $serverCount; $i++ ) {
47
			$server = $lb->getServerInfo( $i );
48
			$server['flags'] |= DBO_DEBUG;
49
			$lb->setServerInfo( $i, $server );
0 ignored issues
show
It seems like $server defined by $lb->getServerInfo($i) on line 47 can also be of type false; however, LoadBalancer::setServerInfo() does only seem to accept array, did you maybe forget to handle an error condition?

This check looks for type mismatches where the missing type is false. This is usually indicative of an error condtion.

Consider the follow example

<?php

function getDate($date)
{
    if ($date !== null) {
        return new DateTime($date);
    }

    return false;
}

This function either returns a new DateTime object or false, if there was an error. This is a typical pattern in PHP programming to show that an error has occurred without raising an exception. The calling code should check for this returned false before passing on the value to another function or method that may not be able to handle a false.

Loading history...
50
		}
51
	}
52
}
53
54
$__useReadline = function_exists( 'readline_add_history' )
55
	&& Maintenance::posix_isatty( 0 /*STDIN*/ );
56
57
if ( $__useReadline ) {
58
	$__historyFile = isset( $_ENV['HOME'] ) ?
59
		"{$_ENV['HOME']}/.mweval_history" : "$IP/maintenance/.mweval_history";
60
	readline_read_history( $__historyFile );
61
}
62
63
$__e = null; // PHP exception
64
while ( ( $__line = Maintenance::readconsole() ) !== false ) {
65
	if ( $__e && !preg_match( '/^(exit|die);?$/', $__line ) ) {
66
		// Internal state may be corrupted or fatals may occur later due
67
		// to some object not being set. Don't drop out of eval in case
68
		// lines were being pasted in (which would then get dumped to the shell).
69
		// Instead, just absorb the remaning commands. Let "exit" through per DWIM.
70
		echo "Exception was thrown before; please restart eval.php\n";
71
		continue;
72
	}
73
	if ( $__useReadline ) {
74
		readline_add_history( $__line );
75
		readline_write_history( $__historyFile );
76
	}
77
	try {
78
		$__val = eval( $__line . ";" );
79
	} catch ( Exception $__e ) {
80
		echo "Caught exception " . get_class( $__e ) .
81
			": {$__e->getMessage()}\n" . $__e->getTraceAsString() . "\n";
82
		continue;
83
	}
84
	if ( wfIsHHVM() || is_null( $__val ) ) {
85
		echo "\n";
86
	} elseif ( is_string( $__val ) || is_numeric( $__val ) ) {
87
		echo "$__val\n";
88
	} else {
89
		var_dump( $__val );
90
	}
91
}
92
93
print "\n";
94