Issues (5)

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/AdbackAnalytics/Driver/SqlScriptCache.php (3 issues)

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
namespace Dekalee\AdbackAnalytics\Driver;
4
5
/**
6
 * Class SqlScriptCache
7
 */
8
abstract class SqlScriptCache
9
{
10
    const ADBACK_ANALYTICS_SCRIPT = 'adback_analytics_script';
11
    const ADBACK_ANALYTICS_URL = 'adback_analytics_url';
12
    const ADBACK_MESSAGE_SCRIPT = 'adback_message_script';
13
    const ADBACK_MESSAGE_URL = 'adback_message_url';
14
    const ADBACK_AUTOPROMO_BANNER_SCRIPT = 'adback_autopromo_banner_script';
15
    const ADBACK_AUTOPROMO_BANNER_URL = 'adback_autopromo_banner_url';
16
    const ADBACK_PRODUCT_SCRIPT = 'adback_product_script';
17
    const ADBACK_PRODUCT_URL = 'adback_product_url';
18
19
    /**
20
     * @return bool
21
     */
22
    public function isAnalyticsConfigured()
23
    {
24
        return null != $this->get(self::ADBACK_ANALYTICS_SCRIPT);
0 ignored issues
show
It seems like you are loosely comparing $this->get(self::ADBACK_ANALYTICS_SCRIPT) of type string|null against null; this is ambiguous if the string can be empty. Consider using a strict comparison !== instead.
Loading history...
25
    }
26
27
    /**
28
     * @param string $domain
29
     */
30
    public function setAnalyticsUrl($domain)
31
    {
32
        $this->set(self::ADBACK_ANALYTICS_URL, $domain);
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getAnalyticsUrl()
39
    {
40
        return $this->get(self::ADBACK_ANALYTICS_URL);
41
    }
42
43
    /**
44
     * @param string $script
45
     */
46
    public function setAnalyticsScript($script)
47
    {
48
        $this->set(self::ADBACK_ANALYTICS_SCRIPT, $script);
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getAnalyticsScript()
55
    {
56
        return $this->get(self::ADBACK_ANALYTICS_SCRIPT);
57
    }
58
59
    /**
60
     * @return bool
61
     */
62
    public function isMessageConfigured()
63
    {
64
        return null != $this->get(self::ADBACK_MESSAGE_SCRIPT);
0 ignored issues
show
It seems like you are loosely comparing $this->get(self::ADBACK_MESSAGE_SCRIPT) of type string|null against null; this is ambiguous if the string can be empty. Consider using a strict comparison !== instead.
Loading history...
65
    }
66
67
    /**
68
     * @return bool
69
     */
70
    public function isAutopromoBannerConfigured()
71
    {
72
        return null != $this->get(self::ADBACK_AUTOPROMO_BANNER_SCRIPT);
0 ignored issues
show
It seems like you are loosely comparing $this->get(self::ADBACK_AUTOPROMO_BANNER_SCRIPT) of type string|null against null; this is ambiguous if the string can be empty. Consider using a strict comparison !== instead.
Loading history...
73
    }
74
75
    /**
76
     * @param string $domain
77
     */
78
    public function setMessageUrl($domain)
79
    {
80
        $this->set(self::ADBACK_MESSAGE_URL, $domain);
81
    }
82
83
    /**
84
     * @return string
85
     */
86
    public function getMessageUrl()
87
    {
88
        return $this->get(self::ADBACK_MESSAGE_URL);
89
    }
90
91
    /**
92
     * @param string $script
93
     */
94
    public function setMessageScript($script)
95
    {
96
        $this->set(self::ADBACK_MESSAGE_SCRIPT, $script);
97
    }
98
99
    /**
100
     * @return string
101
     */
102
    public function getMessageScript()
103
    {
104
        return $this->get(self::ADBACK_MESSAGE_SCRIPT);
105
    }
106
107
    /**
108
     * @param string $domain
109
     */
110
    public function setAutopromoBannerUrl($domain)
111
    {
112
        $this->set(self::ADBACK_AUTOPROMO_BANNER_URL, $domain);
113
    }
114
115
    /**
116
     * @return string
117
     */
118
    public function getAutopromoBannerUrl()
119
    {
120
        return $this->get(self::ADBACK_AUTOPROMO_BANNER_URL);
121
    }
122
123
    /**
124
     * @param string $domain
125
     */
126
    public function setProductUrl($domain)
127
    {
128
        $this->set(self::ADBACK_PRODUCT_URL, $domain);
129
    }
130
131
    /**
132
     * @return string
133
     */
134
    public function getProductUrl()
135
    {
136
        return $this->get(self::ADBACK_PRODUCT_URL);
137
    }
138
139
    /**
140
     * @param string $script
141
     */
142
    public function setAutopromoBannerScript($script)
143
    {
144
        $this->set(self::ADBACK_AUTOPROMO_BANNER_SCRIPT, $script);
145
    }
146
147
    /**
148
     * @return string
149
     */
150
    public function getAutopromoBannerScript()
151
    {
152
        return $this->get(self::ADBACK_AUTOPROMO_BANNER_SCRIPT);
153
    }
154
155
    /**
156
     * @param string $script
157
     */
158
    public function setProductScript($script)
159
    {
160
        $this->set(self::ADBACK_PRODUCT_SCRIPT, $script);
161
    }
162
163
    /**
164
     * @return string
165
     */
166
    public function getProductScript()
167
    {
168
        return $this->get(self::ADBACK_PRODUCT_SCRIPT);
169
    }
170
171
    /**
172
     * Clear analytics data
173
     */
174
    public function clearAnalyticsData()
175
    {
176
        $this->clear(self::ADBACK_ANALYTICS_SCRIPT);
177
        $this->clear(self::ADBACK_ANALYTICS_URL);
178
    }
179
180
    /**
181
     * Clear message data
182
     */
183
    public function clearMessageData()
184
    {
185
        $this->clear(self::ADBACK_MESSAGE_SCRIPT);
186
        $this->clear(self::ADBACK_MESSAGE_URL);
187
    }
188
189
    /**
190
     * Clear autopromo banner data
191
     */
192
    public function clearAutopromoBannerData()
193
    {
194
        $this->clear(self::ADBACK_AUTOPROMO_BANNER_SCRIPT);
195
        $this->clear(self::ADBACK_AUTOPROMO_BANNER_URL);
196
    }
197
198
    /**
199
     * Clear autopromo banner data
200
     */
201
    public function clearProductData()
202
    {
203
        $this->clear(self::ADBACK_PRODUCT_SCRIPT);
204
        $this->clear(self::ADBACK_PRODUCT_URL);
205
    }
206
207
    /**
208
     * @param string $key
209
     *
210
     * @return string|null
211
     */
212
    abstract protected function get($key);
213
214
    /**
215
     * @param string $key
216
     * @param string $value
217
     */
218
    abstract protected function set($key, $value);
219
220
    /**
221
     * @param string $key
222
     */
223
    abstract protected function clear($key);
224
}
225