Issues (132)

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/Issue.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
/**
3
 * @author Patsura Dmitry https://github.com/ovr <[email protected]>
4
 */
5
6
namespace PHPSA;
7
8
/**
9
 * An Issue the compiler or an analyzer found
10
 */
11
class Issue
12
{
13
    /**
14
     * @todo Description
15
     *
16
     * @var string
17
     */
18
    const CATEGORY_BUG_RISK = 'Bug Risk';
19
20
    /**
21
     * @todo Description
22
     *
23
     * @var string
24
     */
25
    const CATEGORY_CLARITY = 'Clarity';
26
27
    /**
28
     * @todo Description
29
     *
30
     * @var string
31
     */
32
    const CATEGORY_COMPATIBILITY = 'Compatibility';
33
34
    /**
35
     * @todo Description
36
     *
37
     * @var string
38
     */
39
    const CATEGORY_COMPLEXITY = 'Complexity';
40
41
    /**
42
     * @todo Description
43
     *
44
     * @var string
45
     */
46
    const CATEGORY_DUPLICATION = 'Duplication';
47
48
    /**
49
     * @todo Description
50
     *
51
     * @var string
52
     */
53
    const CATEGORY_PERFORMANCE = 'Performance';
54
55
    /**
56
     * @todo Description
57
     *
58
     * @var string
59
     */
60
    const CATEGORY_SECURITY = 'Security';
61
62
    /**
63
     * @todo Description
64
     *
65
     * @var string
66
     */
67
    const CATEGORY_STYLE = 'Style';
68
69
    /**
70
     * Required. Must always be "issue".
71
     *
72
     * @var string
73
     */
74
    protected $type = 'issue';
75
76
    /**
77
     * Required. A unique name representing the static analysis check that emitted this issue.
78
     *
79
     * @var string
80
     */
81
    protected $checkName;
82
83
    /**
84
     * Required. A string explaining the issue that was detected.
85
     *
86
     * @var string
87
     */
88
    protected $description;
89
90
    /**
91
     * Optional. A markdown snippet describing the issue, including deeper explanations and links to other resources.
92
     *
93
     * @var string
94
     */
95
    protected $content;
96
97
    /**
98
     * Required. At least one category indicating the nature of the issue being reported.
99
     *
100
     * @var string
101
     */
102
    protected $categories;
103
104
    /**
105
     * Required. A Location object representing the place in the source code where the issue was discovered.
106
     *
107
     * @var IssueLocation
108
     */
109
    protected $location;
110
111
    /**
112
     * @param string $checkName
113
     * @param string $description
114
     * @param IssueLocation $location
115
     * @param array $categories
116
     */
117
    public function __construct($checkName, $description, IssueLocation $location, array $categories = [self::CATEGORY_BUG_RISK])
118
    {
119
        $this->checkName = $checkName;
120
        $this->description = $description;
121
        $this->location = $location;
122
        $this->categories = $categories;
0 ignored issues
show
Documentation Bug introduced by
It seems like $categories of type array is incompatible with the declared type string of property $categories.

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...
123
    }
124
125
    /**
126
     * @return array
127
     */
128
    public function toArray()
129
    {
130
        return [
131
            'type' => $this->type,
132
            'check_name' => $this->checkName,
133
            'description' => $this->description,
134
            'location' => $this->location->toArray(),
135
            'categories' => $this->categories,
136
        ];
137
    }
138
139
    /**
140
     * @return IssueLocation
141
     */
142
    public function getLocation()
143
    {
144
        return $this->location;
145
    }
146
147
    /**
148
     * @return string
149
     */
150
    public function getType()
151
    {
152
        return $this->type;
153
    }
154
155
    /**
156
     * @return string
157
     */
158
    public function getCheckName()
159
    {
160
        return $this->checkName;
161
    }
162
163
    /**
164
     * @return string
165
     */
166
    public function getDescription()
167
    {
168
        return $this->description;
169
    }
170
}
171