Issues (9)

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.

Traits/LazyCalls.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 * Save some calls of driver for future real query invocation
4
 *
5
 * @file      LazyCalls.php
6
 *
7
 * PHP version 8.0+
8
 *
9
 * @author    Yancharuk Alexander <alex at itvault dot info>
10
 * @copyright © 2012-2021 Alexander Yancharuk
11
 * @date      2015-12-26 13:38
12
 * @license   The BSD 3-Clause License
13
 *            <http://opensource.org/licenses/BSD-3-Clause>
14
 */
15
16
namespace Veles\Traits;
17
18
use Exception;
19
20
trait LazyCalls
21
{
22
	/** @var  array */
23
	protected static $calls = [];
24
25
	use Driver;
26
	use SingletonInstance;
27
28
	/**
29
	 * Lazy calls invocation
30
	 */
31 2
	protected static function invokeLazyCalls()
32
	{
33 2
		[$calls, static::$calls] = [static::$calls, []];
34
35 2
		foreach ($calls as $call) {
36 2
			call_user_func_array(
37 2
				[static::instance()->getDriver(), $call['method']],
0 ignored issues
show
It seems like getDriver() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

37
				[static::instance()->/** @scrutinizer ignore-call */ getDriver(), $call['method']],
Loading history...
38 2
				$call['arguments']
39 2
			);
40
		}
41
	}
42
43
	/**
44
	 * @return $this
45
	 */
46 21
	public static function instance()
47
	{
48 21
		if (null === static::$instance) {
49 5
			$class = static::class;
50
51 5
			static::$instance = new $class;
52
		}
53
54 21
		if ([] !== static::$calls) {
55 2
			static::invokeLazyCalls();
56
		}
57
58 21
		return static::$instance;
59
	}
60
61
	/**
62
	 * Collect calls which will be invoked during first real query
63
	 *
64
	 * @param $method
65
	 * @param $arguments
66
	 *
67
	 * @throws Exception
68
	 */
69 2
	public function __call($method, $arguments)
70
	{
71 2
		if (!method_exists($this->getDriver(), $method)) {
72 1
			throw new Exception('Calling non existent method!');
73
		}
74
75 1
		static::addCall($method, $arguments);
76
	}
77
78
	/**
79
	 * Save calls for future invocation
80
	 *
81
	 * @param string $method Method name that should be called
82
	 * @param array $arguments Method arguments
83
	 */
84 2
	public static function addCall($method, array $arguments = [])
85
	{
86 2
		static::$calls[] = [
87 2
			'method'    => $method,
88 2
			'arguments' => $arguments
89 2
		];
90
	}
91
}
92