Issues (1066)

Security Analysis    7 potential vulnerabilities

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

  Cross-Site Scripting (1)
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 (3)
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 (3)
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.

src/Plugin/Scripts.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
namespace PhpQuery\Plugin;
3
4
use PhpQuery\PhpQuery;
5
/**
6
 * PhpQuery plugin class extending PhpQuery object.
7
 * Methods from this class are callable on every PhpQuery object.
8
 *
9
 * Class name prefix '\PhpQuery\Plugin\' must be preserved.
10
 */
11
abstract class Scripts {
12
	/**
13
	 * Limit binded methods.
14
	 *
15
	 * null means all public.
16
	 * array means only specified ones.
17
	 *
18
	 * @var array|null
19
	 */
20
	public static $PhpQueryMethods = null;
21
	public static $config = array();
22
23
    /**
24
     * Enter description here...
25
     *
26
     * @param \PhpQuery\PhpQueryObject $self
27
     * @param                          $arg1
28
     * @return null|\PhpQuery\PhpQueryObject
29
     */
30
	public static function script($self, $arg1) {
31
		$params = func_get_args();
32
		$params = array_slice($params, 2);
33
		$return = null;
34
		$config = self::$config;
35
		if (\PhpQuery\Plugin\UtilScripts::$scriptMethods[$arg1]) {
36
			PhpQuery::callbackRun(
37
				\PhpQuery\Plugin\UtilScripts::$scriptMethods[$arg1],
38
				array($self, $params, &$return, $config)
39
			);
40
		} else if ($arg1 != '__config' && file_exists(dirname(__FILE__)."/Scripts/$arg1.php")) {
41
			PhpQuery::debug("Loading script '$arg1'");
42
			require dirname(__FILE__)."/Scripts/$arg1.php";
43
		} else {
44
			PhpQuery::debug("Requested script '$arg1' doesn't exist");
45
		}
46
		return $return
47
			? $return
48
			: $self;
49
	}
50
}
51
abstract class UtilScripts {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class should be in its own file to aid autoloaders.

Having each class in a dedicated file usually plays nice with PSR autoloaders and is therefore a well established practice. If you use other autoloaders, you might not want to follow this rule.

Loading history...
52
	public static $scriptMethods = array();
53
	public static function __initialize() {
54
		if (file_exists(dirname(__FILE__)."/Scripts/__config.php")) {
55
			include dirname(__FILE__)."/Scripts/__config.php";
56
			\PhpQuery\Plugin\Scripts::$config = $config;
0 ignored issues
show
The variable $config does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
57
		}
58
	}
59
60
    /**
61
     * Extend scripts' namespace with $name related with $callback.
62
     *
63
     * Callback parameter order looks like this:
64
     * - $this
65
     * - $params
66
     * - &$return
67
     * - $config
68
     *
69
     * @param $name
70
     * @param $callback
71
     * @throws \Exception
72
     * @return bool
73
     */
74
	public static function script($name, $callback) {
75
		if (\PhpQuery\Plugin\UtilScripts::$scriptMethods[$name])
76
			throw new \Exception("Script name conflict - '$name'");
77
		\PhpQuery\Plugin\UtilScripts::$scriptMethods[$name] = $callback;
78
	}
79
}