Issues (7)

Security Analysis    no request data  

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.

src/IPub/WebSocketsWAMPClient/Logger/Console.php (1 issue)

Labels
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
 * Console.php
4
 *
5
 * @copyright      More in license.md
6
 * @license        https://www.ipublikuj.eu
7
 * @author         Adam Kadlec <[email protected]>
8
 * @package        iPublikuj:WebSocketsWAMPClient!
9
 * @subpackage     Logger
10
 * @since          1.0.0
11
 *
12
 * @date           11.05.18
13
 */
14
15
declare(strict_types = 1);
16
17
namespace IPub\WebSocketsWAMPClient\Logger;
18
19
use Nette;
20
21
use Psr\Log;
22
23
use IPub;
24
25
/**
26
 * WebSocketsWAMPClient server output printer
27
 *
28
 * @package        iPublikuj:WebSocketsWAMPClient!
29
 * @subpackage     Logger
30
 *
31
 * @author         Adam Kadlec <[email protected]>
32
 */
33 1
final class Console implements Log\LoggerInterface
34
{
35
	/**
36
	 * Implement nette smart magic
37
	 */
38 1
	use Nette\SmartObject;
39
40
	/**
41
	 * @var Formatter\IFormatter
42
	 */
43
	private $formatter;
44
45
	/**
46
	 * @param Formatter\IFormatter $formatter
47
	 *
48
	 * @return void
49
	 */
50
	public function setFormatter(Formatter\IFormatter $formatter)
51
	{
52
		$this->formatter = $formatter;
53
	}
54
55
	/**
56
	 * {@inheritdoc}
57
	 */
58
	public function emergency($message, array $context = [])
59
	{
60
		if ($this->formatter) {
61
			$this->formatter->caution($message);
62
63
		} else {
64
			echo 'CAUTION! ';
65
66
			$this->writeln($message);
67
		}
68
	}
69
70
	/**
71
	 * {@inheritdoc}
72
	 */
73
	public function alert($message, array $context = [])
74
	{
75
		if ($this->formatter) {
76
			$this->formatter->error($message);
77
78
		} else {
79
			echo 'ERROR! ';
80
81
			$this->writeln($message);
82
		}
83
	}
84
85
	/**
86
	 * {@inheritdoc}
87
	 */
88
	public function critical($message, array $context = [])
89
	{
90
		if ($this->formatter) {
91
			$this->formatter->error($message);
92
93
		} else {
94
			echo 'ERROR! ';
95
96
			$this->writeln($message);
97
		}
98
	}
99
100
	/**
101
	 * {@inheritdoc}
102
	 */
103
	public function error($message, array $context = [])
104
	{
105
		if ($this->formatter) {
106
			$this->formatter->error($message);
107
108
		} else {
109
			echo 'ERROR! ';
110
111
			$this->writeln($message);
112
		}
113
	}
114
115
	/**
116
	 * {@inheritdoc}
117
	 */
118
	public function warning($message, array $context = [])
119
	{
120
		if ($this->formatter) {
121
			$this->formatter->warning($message);
122
123
		} else {
124
			echo 'WARNING! ';
125
126
			$this->writeln($message);
127
		}
128
	}
129
130
	/**
131
	 * {@inheritdoc}
132
	 */
133
	public function notice($message, array $context = [])
134
	{
135
		if ($this->formatter) {
136
			$this->formatter->note($message);
137
138
		} else {
139
			echo 'NOTICE! ';
140
141
			$this->writeln($message);
142
		}
143
	}
144
145
	/**
146
	 * {@inheritdoc}
147
	 */
148
	public function info($message, array $context = [])
149
	{
150
		if ($this->formatter) {
151
			$this->formatter->note($message);
152
153
		} else {
154
			echo 'INFO: ';
155
156
			$this->writeln($message);
157
		}
158
	}
159
160
	/**
161
	 * {@inheritdoc}
162
	 */
163
	public function debug($message, array $context = [])
164
	{
165
		if ($this->formatter) {
166
			$this->formatter->note($message);
167
168
		} else {
169
			echo 'DEBUG: ';
170
171
			$this->writeln($message);
172
		}
173
	}
174
175
	/**
176
	 * {@inheritdoc}
177
	 */
178
	public function log($level, $message, array $context = [])
179
	{
180
		if ($this->formatter) {
181
			$this->formatter->note($message);
182
183
		} else {
184
			echo 'LOG: ';
185
186
			$this->writeln($message);
187
		}
188
	}
189
190
	/**
191
	 * @param string $message
192
	 */
193
	private function writeln(string $message)
194
	{
195
		if ($this->formatter) {
196
			$this->formatter->writeln($message);
0 ignored issues
show
The method writeln() does not seem to exist on object<IPub\WebSocketsWA...r\Formatter\IFormatter>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
197
198
		} else {
199
			echo $message . "\r\n";
200
		}
201
	}
202
}
203