Issues (3)

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.

Security/User/AdUser.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
namespace Riper\Security\ActiveDirectoryBundle\Security\User;
4
5
use Symfony\Component\Security\Core\User\UserInterface;
6
7
class AdUser implements UserInterface
8
{
9
    /** @var string */
10
    private $username;
11
12
    /** @var string */
13
    private $password;
14
15
    /** @var array */
16
    private $roles;
17
18
    /** @var string */
19
    private $displayName;
20
21
    /** @var string */
22
    private $email;
23
24
    public function __construct($username, $password, array $roles)
25
    {
26
        $this->username = $username;
27
        $this->password = $password;
28
        $this->roles = $roles;
29
    }
30
31
    /**
32
     * Returns the password used to authenticate the user.
33
     *
34
     * This should be the encoded password. On authentication, a plain-text
35
     * password will be salted, encoded, and then compared to this value.
36
     *
37
     * @return string The password
38
     */
39
    public function getPassword()
40
    {
41
        return $this->password;
42
    }
43
44
    /**
45
     * Sets the password used to authenticate the user.
46
     *
47
     * This should be the encoded password.
48
     *
49
     * @param string $password
50
     */
51
    public function setPassword($password)
52
    {
53
        $this->password = $password;
54
    }
55
56
    /**
57
     * Returns the salt that was originally used to encode the password.
58
     *
59
     * This can return null if the password was not encoded using a salt.
60
     *
61
     * @return string The salt
0 ignored issues
show
Should the return type not be string|null?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
62
     */
63
    public function getSalt()
64
    {
65
        return null;
66
    }
67
68
    /**
69
     * Returns the username used to authenticate the user.
70
     *
71
     * @return string The username
72
     */
73
    public function getUsername()
74
    {
75
        return $this->username;
76
    }
77
78
    /**
79
     * Returns the display name of the authenticated user.
80
     *
81
     * @return string
82
     */
83
    public function getDisplayName()
84
    {
85
        return $this->displayName;
86
    }
87
88
    /**
89
     * Set the display name of the authenticated user.
90
     *
91
     * @param string $displayName
92
     */
93
    public function setDisplayName($displayName)
94
    {
95
        $this->displayName = $displayName;
96
    }
97
98
    /**
99
     * Returns the email address of the authenticated user.
100
     *
101
     * @return string
102
     */
103
    public function getEmail()
104
    {
105
        return $this->email;
106
    }
107
108
    /**
109
     * Set the email address of the authenticated user.
110
     *
111
     * @param string $email
112
     */
113
    public function setEmail($email)
114
    {
115
        $this->email = $email;
116
    }
117
118
    /**
119
     * Removes sensitive data from the user.
120
     *
121
     * This is important if, at any given point, sensitive information like
122
     * the plain-text password is stored on this object.
123
     *
124
     * @return void
125
     */
126
    public function eraseCredentials()
127
    {
128
        //return void;
129
    }
130
131
    /**
132
     * Returns the roles granted to the user.
133
     *
134
     * <code>
135
     * public function getRoles()
136
     * {
137
     *     return array('ROLE_USER');
138
     * }
139
     * </code>
140
     *
141
     * Alternatively, the roles might be stored on a ``roles`` property,
142
     * and populated in any number of different ways when the user object
143
     * is created.
144
     *
145
     * @return array Role[] The user roles
146
     */
147
    public function getRoles()
148
    {
149
        return  $this->roles;
150
    }
151
152
    /**
153
     * Sets the roles for the user.
154
     *
155
     * @param array $roles
156
     */
157
    public function setRoles(array $roles)
158
    {
159
        $this->roles = $roles;
160
    }
161
}
162