Issues (1)

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/ClientSession.php (1 issue)

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
declare(strict_types=1);
3
4
/**
5
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
 */
17
18
namespace Ytake\PrestoClient;
19
20
use Ramsey\Uuid\UuidInterface;
21
use Ytake\PrestoClient\Session\Property;
22
use Ytake\PrestoClient\Session\PreparedStatement;
23
24
/**
25
 * Class PrestoSession
26
 *
27
 * @author Yuuki Takezawa <[email protected]>
28
 */
29
class ClientSession
30
{
31
    /** @var string */
32
    protected $host;
33
34
    /** @var string */
35
    protected $catalog;
36
37
    /** @var UuidInterface */
38
    protected $transactionId;
39
40
    /** @var string */
41
    protected $schema = 'default';
42
43
    /** @var string */
44
    protected $header = [];
45
46
    /** @var string */
47
    protected $user = 'presto';
48
49
    /** @var string */
50
    protected $source = PrestoHeaders::PRESTO_SOURCE_VALUE;
51
52
    /** @var Property[] */
53
    protected $property = [];
54
55
    /** @var PreparedStatement[] */
56
    protected $preparedStatement = [];
57
58
    /**
59
     * PrestoSession constructor.
60
     *
61
     * @param string $host
62
     * @param string $catalog
63
     */
64
    public function __construct(string $host, string $catalog)
65
    {
66
        $this->host = $host;
67
        $this->catalog = $catalog;
68
    }
69
70
    /**
71
     * @param string $schema
72
     */
73
    public function setSchema(string $schema)
74
    {
75
        $this->schema = $schema;
76
    }
77
78
    /**
79
     * @param array $header
80
     */
81
    public function setHeader(array $header)
82
    {
83
        $this->header = $header;
0 ignored issues
show
Documentation Bug introduced by
It seems like $header of type array is incompatible with the declared type string of property $header.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
84
    }
85
86
    /**
87
     * @param string $user
88
     */
89
    public function setUser(string $user)
90
    {
91
        $this->user = $user;
92
    }
93
94
    /**
95
     * @param string $source
96
     */
97
    public function setSource(string $source)
98
    {
99
        $this->source = $source;
100
    }
101
102
    /**
103
     * @param UuidInterface $transactionId
104
     */
105
    public function setTransactionId(UuidInterface $transactionId)
106
    {
107
        $this->transactionId = $transactionId;
108
    }
109
110
    /**
111
     * @param Property $property
112
     */
113
    public function setProperty(Property $property)
114
    {
115
        $this->property[] = $property;
116
    }
117
118
    /**
119
     * @param PreparedStatement $preparedStatement
120
     */
121
    public function setPreparedStatement(PreparedStatement $preparedStatement)
122
    {
123
        $this->preparedStatement[] = $preparedStatement;
124
    }
125
126
    /**
127
     * @return Property[]
128
     */
129
    public function getProperty(): array
130
    {
131
        return $this->property;
132
    }
133
134
    /**
135
     * @return PreparedStatement[]
136
     */
137
    public function getPreparedStatement(): array
138
    {
139
        return $this->preparedStatement;
140
    }
141
142
    /**
143
     * @return string
144
     */
145
    public function getHost(): string
146
    {
147
        return $this->host;
148
    }
149
150
    /**
151
     * @return string
152
     */
153
    public function getCatalog(): string
154
    {
155
        return $this->catalog;
156
    }
157
158
    /**
159
     * @return array
160
     */
161
    public function getHeader(): array
162
    {
163
        return $this->header;
164
    }
165
166
    /**
167
     * @return string
168
     */
169
    public function getSchema(): string
170
    {
171
        return $this->schema;
172
    }
173
174
    /**
175
     * @return string
176
     */
177
    public function getUser(): string
178
    {
179
        return $this->user;
180
    }
181
182
    /**
183
     * @return string
184
     */
185
    public function getSource(): string
186
    {
187
        return $this->source;
188
    }
189
190
    /**
191
     * @return UuidInterface|null
192
     */
193
    public function getTransactionId()
194
    {
195
        return $this->transactionId;
196
    }
197
}
198