Issues (78)

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.

src/console/ServerRequest.php (3 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
3
namespace hiapi\console;
4
5
use Psr\Http\Message\ServerRequestInterface;
6
use Psr\Http\Message\UriInterface;
7
use Psr\Http\Message\StreamInterface;
8
9
/**
10
 * PSR-7 compatible console ServerRequest
11
 *
12
 * XXX
13
 * XXX NOT finished, NOT used
14
 * XXX
15
 * @
16
 * @author Andrii Vasyliev <[email protected]>
17
 */
18
class ServerRequest implements ServerRequestInterface
19
{
20
21
    protected $route;
22
23
    protected $params;
24
25
    public function getQueryParams()
26
    {
27
        if ($this->params === null) {
28
            $this->params = $this->parseParams();
0 ignored issues
show
Are you sure the assignment to $this->params is correct as $this->parseParams() (which targets hiapi\console\ServerRequest::parseParams()) seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
29
        }
30
31
        return $this->params;
32
    }
33
34
    protected function parseParams()
35
    {
36
        if (isset($_SERVER['argv'])) {
37
            $args = $_SERVER['argv'];
38
            array_shift($this->_params);
0 ignored issues
show
The property _params does not seem to exist. Did you mean params?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
39
        } else {
40
            $args = [];
41
        }
42
        foreach ($args as $arg) {
43
            var_dump($arg);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($arg); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
44
        }
45
        die;
46
    }
47
48
    public function getParsedBody()
49
    {
50
        return [];
51
    }
52
53
    public function getServerParams()
54
    {
55
        throw new \Exception('not implemented');
56
    }
57
58
    public function getCookieParams()
59
    {
60
        throw new \Exception('not implemented');
61
    }
62
63
    public function withCookieParams(array $cookies)
64
    {
65
        throw new \Exception('not implemented');
66
    }
67
68
    public function withQueryParams(array $query)
69
    {
70
        throw new \Exception('not implemented');
71
    }
72
73
    public function getUploadedFiles()
74
    {
75
        throw new \Exception('not implemented');
76
    }
77
78
    public function withUploadedFiles(array $uploadedFiles)
79
    {
80
        throw new \Exception('not implemented');
81
    }
82
83
    public function withParsedBody($data)
84
    {
85
        throw new \Exception('not implemented');
86
    }
87
88
    public function getAttributes()
89
    {
90
        throw new \Exception('not implemented');
91
    }
92
93
    public function getAttribute($name, $default = null)
94
    {
95
        throw new \Exception('not implemented');
96
    }
97
98
    public function withAttribute($name, $value)
99
    {
100
        throw new \Exception('not implemented');
101
    }
102
103
    public function withoutAttribute($name)
104
    {
105
        throw new \Exception('not implemented');
106
    }
107
108
    public function getRequestTarget()
109
    {
110
        throw new \Exception('not implemented');
111
    }
112
113
    public function withRequestTarget($requestTarget)
114
    {
115
        throw new \Exception('not implemented');
116
    }
117
118
    public function getMethod()
119
    {
120
        throw new \Exception('not implemented');
121
    }
122
123
    public function withMethod($method)
124
    {
125
        throw new \Exception('not implemented');
126
    }
127
128
    public function getUri()
129
    {
130
        throw new \Exception('not implemented');
131
    }
132
133
    public function withUri(UriInterface $uri, $preserveHost = false)
134
    {
135
        throw new \Exception('not implemented');
136
    }
137
138
    public function getProtocolVersion()
139
    {
140
        throw new \Exception('not implemented');
141
    }
142
143
    public function withProtocolVersion($version)
144
    {
145
        throw new \Exception('not implemented');
146
    }
147
148
    public function getHeaders()
149
    {
150
        throw new \Exception('not implemented');
151
    }
152
153
    public function hasHeader($name)
154
    {
155
        throw new \Exception('not implemented');
156
    }
157
158
    public function getHeader($name)
159
    {
160
        throw new \Exception('not implemented');
161
    }
162
163
    public function getHeaderLine($name)
164
    {
165
        throw new \Exception('not implemented');
166
    }
167
168
    public function withHeader($name, $value)
169
    {
170
        throw new \Exception('not implemented');
171
    }
172
173
    public function withAddedHeader($name, $value)
174
    {
175
        throw new \Exception('not implemented');
176
    }
177
178
    public function withoutHeader($name)
179
    {
180
        throw new \Exception('not implemented');
181
    }
182
183
    public function getBody()
184
    {
185
        throw new \Exception('not implemented');
186
    }
187
188
    public function withBody(StreamInterface $body)
189
    {
190
        throw new \Exception('not implemented');
191
    }
192
}
193