Issues (4)

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/Models/AbstractWidget.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
declare(strict_types=1);
4
5
namespace Rinvex\Widgets\Models;
6
7
abstract class AbstractWidget
8
{
9
    /**
10
     * The number of seconds before each reload.
11
     *
12
     * @var float
13
     */
14
    protected $reloadTimeout;
15
16
    /**
17
     * The unique id of the widget being called.
18
     *
19
     * @var string
20
     */
21
    protected $id;
22
23
    /**
24
     * Array of widget parameters.
25
     *
26
     * @var array
27
     */
28
    protected $params = [];
29
30
    /**
31
     * The widget container template.
32
     *
33
     * @var string
34
     */
35
    protected $container = 'rinvex/widgets::container';
36
37
    /**
38
     * Constructor.
39
     *
40
     * @param array $params
41
     */
42
    public function __construct(array $params = [])
43
    {
44
        $this->params = $params;
45
        $this->id = spl_object_hash($this);
46
    }
47
48
    /**
49
     * Get the widget reload timeout.
50
     *
51
     * @return float|null
52
     */
53
    public function getReloadTimeout()
54
    {
55
        return $this->reloadTimeout;
56
    }
57
58
    /**
59
     * Set the widget reload timeout.
60
     *
61
     * @param float $reloadTimeout
62
     *
63
     * @return $this
64
     */
65
    public function setReloadTimeout(float $reloadTimeout)
66
    {
67
        $this->reloadTimeout = $reloadTimeout;
68
69
        return $this;
70
    }
71
72
    /**
73
     * Get the widget id.
74
     *
75
     * @return string
76
     */
77
    public function getId(): string
78
    {
79
        return $this->id;
80
    }
81
82
    /**
83
     * Set the widget id.
84
     *
85
     * @param string $id
86
     *
87
     * @return $this
88
     */
89
    public function setId(string $id)
90
    {
91
        $this->id = $id;
92
93
        return $this;
94
    }
95
96
    /**
97
     * Get the widget params.
98
     *
99
     * @return array
100
     */
101
    public function getParams(): array
102
    {
103
        return $this->params;
104
    }
105
106
    /**
107
     * Set the widget params.
108
     *
109
     * @param array $params
110
     *
111
     * @return $this
112
     */
113
    public function setParams(array $params)
114
    {
115
        $this->params = $params;
116
117
        return $this;
118
    }
119
120
    /**
121
     * Get a widget param.
122
     *
123
     * @return mixed
124
     */
125
    public function getParam(string $key)
126
    {
127
        return $this->param[$key] ?? null;
0 ignored issues
show
The property param 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...
128
    }
129
130
    /**
131
     * Set a widget param.
132
     *
133
     * @param mixed $key
134
     * @param mixed $value
135
     *
136
     * @return $this
137
     */
138
    public function setParam($key, $value)
139
    {
140
        $this->params[$key] = $value;
141
142
        return $this;
143
    }
144
145
    /**
146
     * Get the widget container.
147
     *
148
     * @return string
149
     */
150
    public function getContainer(): string
151
    {
152
        return $this->container;
153
    }
154
155
    /**
156
     * Set the widget container.
157
     *
158
     * @param string $container
159
     *
160
     * @return $this
161
     */
162
    public function setContainer(string $container)
163
    {
164
        $this->container = $container;
165
166
        return $this;
167
    }
168
}
169