Issues (2010)

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.

wp-includes/ms-settings.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
 * Used to set up and fix common variables and include
4
 * the Multisite procedural and class library.
5
 *
6
 * Allows for some configuration in wp-config.php (see ms-default-constants.php)
7
 *
8
 * @package WordPress
9
 * @subpackage Multisite
10
 * @since 3.0.0
11
 */
12
13
/**
14
 * Objects representing the current network and current site.
15
 *
16
 * These may be populated through a custom `sunrise.php`. If not, then this
17
 * file will attempt to populate them based on the current request.
18
 *
19
 * @global WP_Network $current_site The current network.
20
 * @global object     $current_blog The current site.
21
 * @since 3.0.0
22
 */
23
global $current_site, $current_blog;
24
25
/** WP_Network class */
26
require_once( ABSPATH . WPINC . '/class-wp-network.php' );
27
28
/** WP_Site class */
29
require_once( ABSPATH . WPINC . '/class-wp-site.php' );
30
31
/** Multisite loader */
32
require_once( ABSPATH . WPINC . '/ms-load.php' );
33
34
/** Default Multisite constants */
35
require_once( ABSPATH . WPINC . '/ms-default-constants.php' );
36
37
if ( defined( 'SUNRISE' ) ) {
38
	include_once( WP_CONTENT_DIR . '/sunrise.php' );
39
}
40
41
/** Check for and define SUBDOMAIN_INSTALL and the deprecated VHOST constant. */
42
ms_subdomain_constants();
43
44
// This block will process a request if the current network or current site objects
45
// have not been populated in the global scope through something like `sunrise.php`.
46
if ( !isset( $current_site ) || !isset( $current_blog ) ) {
47
48
	$domain = strtolower( stripslashes( $_SERVER['HTTP_HOST'] ) );
49
	if ( substr( $domain, -3 ) == ':80' ) {
50
		$domain = substr( $domain, 0, -3 );
51
		$_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -3 );
52
	} elseif ( substr( $domain, -4 ) == ':443' ) {
53
		$domain = substr( $domain, 0, -4 );
54
		$_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 );
55
	}
56
57
	$path = stripslashes( $_SERVER['REQUEST_URI'] );
58
	if ( is_admin() ) {
59
		$path = preg_replace( '#(.*)/wp-admin/.*#', '$1/', $path );
60
	}
61
	list( $path ) = explode( '?', $path );
62
63
	$bootstrap_result = ms_load_current_site_and_network( $domain, $path, is_subdomain_install() );
64
65
	if ( true === $bootstrap_result ) {
0 ignored issues
show
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
66
		// `$current_blog` and `$current_site are now populated.
67
	} elseif ( false === $bootstrap_result ) {
68
		ms_not_installed( $domain, $path );
69
	} else {
70
		header( 'Location: ' . $bootstrap_result );
71
		exit;
72
	}
73
	unset( $bootstrap_result );
74
75
	$blog_id = $current_blog->blog_id;
76
	$public  = $current_blog->public;
77
78
	if ( empty( $current_blog->site_id ) ) {
79
		// This dates to [MU134] and shouldn't be relevant anymore,
80
		// but it could be possible for arguments passed to insert_blog() etc.
81
		$current_blog->site_id = 1;
82
	}
83
84
	$site_id = $current_blog->site_id;
85
	wp_load_core_site_options( $site_id );
86
}
87
88
$wpdb->set_prefix( $table_prefix, false ); // $table_prefix can be set in sunrise.php
89
$wpdb->set_blog_id( $current_blog->blog_id, $current_blog->site_id );
90
$table_prefix = $wpdb->get_blog_prefix();
91
$_wp_switched_stack = array();
92
$switched = false;
93
94
// need to init cache again after blog_id is set
95
wp_start_object_cache();
96
97
if ( ! $current_site instanceof WP_Network ) {
98
	$current_site = new WP_Network( $current_site );
99
}
100
101
if ( ! $current_blog instanceof WP_Site ) {
102
	$current_blog = new WP_Site( $current_blog );
103
}
104
105
// Define upload directory constants
106
ms_upload_constants();
107
108
/**
109
 * Fires after the current site and network have been detected and loaded
110
 * in multisite's bootstrap.
111
 *
112
 * @since 4.6.0
113
 */
114
do_action( 'ms_loaded' );
115