Issues (461)

Branch: master

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

includes/classes/class-lsx-rest-helper.php (9 issues)

1
<?php
0 ignored issues
show
This file is missing a doc comment.
Loading history...
2
3
if ( ! defined( 'ABSPATH' ) ) {
4
	exit;
5
}
6
7
/**
8
 * Holds functions for rest api specific actions.
9
 *
10
 * @author   LightSpeed
11
 * @category Widgets
12
 * @package  LSX
13
 * @return   LSX_Rest_Helper
14
 */
15
class LSX_Rest_Helper {
16
17
	/**
18
	 * Holds class instance
19
	 *
20
	 * @since 1.0.0
21
	 * @var      object
22
	 */
23
	protected static $instance = null;
24
25
	/**
26
	 * Holds the conditional.
27
	 *
28
	 * @var boolean
29
	 */
30
	protected $is_rest_request = false;
31
32
	/**
33
	 * Constructor.
34
	 */
35
	public function __construct() {
36
		add_filter( 'tribe_events_views_v2_rest_params', array( $this, 'check_event_request' ), 10, 2 );
37
	}
38
	/**
39
	 * Return an instance of this class.
40
	 *
41
	 * @since 1.0.0
42
	 * @return    object    A single instance of this class.
43
	 */
44
	public static function get_instance() {
45
		// If the single instance hasn't been set, set it now.
46
		if ( null === self::$instance ) {
47
			self::$instance = new self;
0 ignored issues
show
Parenthesis should always be used when instantiating a new object.
Loading history...
48
		}
49
		return self::$instance;
50
	}
51
52
	/**
53
	 * This will set the 'is_rest_request' variable as true if it runs. Tribe has already done the checkes for us.
54
	 *
55
	 * @param array $params
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
56
	 * @param array $request
0 ignored issues
show
Coding Style Documentation introduced by
Missing parameter comment
Loading history...
57
	 * @return void
0 ignored issues
show
Function return type is void, but function contains return statement
Loading history...
58
	 */
59
	public function check_event_request( $params, $request ) {
0 ignored issues
show
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

59
	public function check_event_request( $params, /** @scrutinizer ignore-unused */ $request ) {

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

Loading history...
60
		$this->is_rest_request = true;
61
		return $params;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $params returns the type array which is incompatible with the documented return type void.
Loading history...
62
	}
63
64
	/**
65
	 * Determines if the request is an REST API request.
66
	 *
67
	 * @return bool True if it's a REST API request, false otherwise.
68
	 */
69
	public function is_rest_api_request() {
70
		if ( true === $this->is_rest_request ) {
71
			return $this->is_rest_request;
72
		}
73
74
		if ( empty( $_SERVER['REQUEST_URI'] ) ) {
75
			return false;
76
		}
77
		$rest_prefix         = trailingslashit( rest_get_url_prefix() );
78
		$this->is_rest_request = ( false !== strpos( $_SERVER['REQUEST_URI'], $rest_prefix ) );
0 ignored issues
show
$_SERVER data not unslashed before sanitization. Use wp_unslash() or similar
Loading history...
Detected usage of a non-sanitized input variable: $_SERVER['REQUEST_URI']
Loading history...
79
		return $this->is_rest_request;
80
	}
81
}
82
$rest_helper = LSX_Rest_Helper::get_instance();
83