Issues (24)

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.

example/User.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
namespace PhpAbac\Example;
4
5
class User
6
{
7
    /** @var int **/
8
    private $id;
9
    /** @var string **/
10
    private $name;
11
    /** @var int **/
12
    private $age;
13
    /** @var string **/
14
    private $parentNationality;
15
    /** @var array **/
16
    private $visas;
17
    /** @var bool **/
18
    private $hasDoneJapd;
19
    /** @var bool **/
20
    private $hasDrivingLicense;
21
    /** @var string Iso code of user country */
22
    private $country;
23
24
    /**
25
     * @param int $id
26
     * @return \PhpAbac\Example\User
27
     */
28 8
    public function setId($id)
29
    {
30 8
        $this->id = $id;
31
        
32 8
        return $this;
33
    }
34
    
35
    /**
36
     * @return int
37
     */
38 1
    public function getId()
39
    {
40 1
        return $this->id;
41
    }
42
    
43
    /**
44
     * @param string $name
45
     * @return \PhpAbac\Example\User
46
     */
47 6
    public function setName($name)
48
    {
49 6
        $this->name = $name;
50
        
51 6
        return $this;
52
    }
53
    
54
    /**
55
     * @return string
56
     */
57
    public function getName()
58
    {
59
        return $this->name;
60
    }
61
    
62
    /**
63
     * @param int $age
64
     * @return \PhpAbac\Example\User
65
     */
66 8
    public function setAge($age)
67
    {
68 8
        $this->age = $age;
69
        
70 8
        return $this;
71
    }
72
    
73
    /**
74
     * @return int
75
     */
76 5
    public function getAge()
77
    {
78 5
        return $this->age;
79
    }
80
    
81
    /**
82
     * @param string $parentNationality
83
     * @return \PhpAbac\Example\User
84
     */
85 7
    public function setParentNationality($parentNationality)
86
    {
87 7
        $this->parentNationality = $parentNationality;
88
        
89 7
        return $this;
90
    }
91
    
92
    /**
93
     * @return bool
94
     */
95 1
    public function getParentNationality()
96
    {
97 1
        return $this->parentNationality;
98
    }
99
    
100
    /**
101
     * @param \PhpAbac\Example\Visa $visa
102
     * @return \PhpAbac\Example\User
103
     */
104 6
    public function addVisa(Visa $visa)
105
    {
106 6
        $this->visas[$visa->getId()] = $visa;
107
        
108 6
        return $this;
109
    }
110
    
111
    /**
112
     * @param \PhpAbac\Example\Visa $visa
113
     * @return \PhpAbac\Example\User
114
     */
115
    public function removeVisa(Visa $visa)
116
    {
117
        if (isset($this->visas[$visa->getId()])) {
118
            unset($this->visas[$visa->getId()]);
119
        }
120
        return $this;
121
    }
122
    
123
    /**
124
     * @return array
125
     */
126 1
    public function getVisas()
127
    {
128 1
        return $this->visas;
129
    }
130
    
131
    /**
132
     * Return a specific visa
133
     *
134
     * @param Visa $visa
0 ignored issues
show
There is no parameter named $visa. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
135
     *
136
     * @return mixed|null
137
     */
138 2
    public function getVisa($country_code)
139
    {
140
        /** @var Visa $visa */
141 2
        $visas = [];
142 2
        foreach ($this->visas as $visa) {
143 2
            if ($visa->getCountry()->getCode() == $country_code) {
144 2
                $visas[] = $visa;
145
            }
146
        }
147 2
        return $visas;
148
    }
149
    
150
    /**
151
     * @param bool $hasDoneJapd
152
     * @return \PhpAbac\Example\User
153
     */
154 6
    public function setHasDoneJapd($hasDoneJapd)
155
    {
156 6
        $this->hasDoneJapd = $hasDoneJapd;
157
        
158 6
        return $this;
159
    }
160
    
161
    /**
162
     * @return bool
163
     */
164 1
    public function getHasDoneJapd()
165
    {
166 1
        return $this->hasDoneJapd;
167
    }
168
    
169
    /**
170
     * @param bool $hasDrivingLicense
171
     * @return \PhpAbac\Example\User
172
     */
173 6
    public function setHasDrivingLicense($hasDrivingLicense)
174
    {
175 6
        $this->hasDrivingLicense = $hasDrivingLicense;
176
        
177 6
        return $this;
178
    }
179
    
180
    /**
181
     * @return bool
182
     */
183 1
    public function getHasDrivingLicense()
184
    {
185 1
        return $this->hasDrivingLicense;
186
    }
187
188
189
    /**
190
     * Function to set the iso code of the user country
191
     *
192
     * @param $country
193
     */
194 5
    public function setCountry($country)
195
    {
196 5
        $this->country = $country;
197
198 5
        return $this;
199
    }
200
201
    /**
202
     * @return string Iso code of the user country
203
     */
204 1
    public function getCountry()
205
    {
206 1
        return $this->country;
207
    }
208
}
209