Issues (12)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

Entity/User.php (3 issues)

1
<?php
2
3
namespace Matks\Bundle\CustomerSupportBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
7
use Symfony\Component\Validator\Constraints as Assert;
8
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
9
use LogicException;
10
11
use Matks\Bundle\CustomerSupportBundle\Model\UserInterface;
12
13
/**
14
 * User entity
15
 *
16
 * @ORM\Entity(repositoryClass="Matks\Bundle\CustomerSupportBundle\Repository\UserRepository")
17
 * @ORM\InheritanceType("SINGLE_TABLE")
18
 * @ORM\DiscriminatorColumn(name="discr", type="string")
19
 * @ORM\Table(name="users", indexes={@ORM\Index(name="user_email_idx", columns={"email"})})
20
 * @UniqueEntity(fields="email", message="this email already exists")
21
 * @ORM\HasLifecycleCallbacks
22
 *
23
 * @author Mathieu Ferment <[email protected]>
24
 */
25
class User implements UserInterface
26
{
27
    use ORMBehaviors\Timestampable\Timestampable;
28
29
    /**
30
     * @var int
31
     *
32
     * @ORM\Id
33
     * @ORM\Column(type="integer")
34
     * @ORM\GeneratedValue(strategy="AUTO")
35
     */
36
    private $id;
0 ignored issues
show
The private property $id is not used, and could be removed.
Loading history...
37
38
    /**
39
     * @var string
40
     *
41
     * @ORM\Column(type="string", length=255)
42
     */
43
    private $email;
44
45
    /**
46
     * @var string
47
     *
48
     * @ORM\Column(type="string", length=255, name="first_name")
49
     * @Assert\NotBlank()
50
     */
51
    private $firstName;
52
53
    /**
54
     * @var string
55
     *
56
     * @ORM\Column(type="string", length=255, name="last_name")
57
     * @Assert\NotBlank()
58
     */
59
    private $lastName;
60
61
    /**
62
     * @var Name
0 ignored issues
show
The type Matks\Bundle\CustomerSupportBundle\Entity\Name was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
63
     */
64
    private $name;
0 ignored issues
show
The private property $name is not used, and could be removed.
Loading history...
65
66
    /**
67
     * Constructor
68
     *
69
     * @param string $firstName
70
     * @param string $lastName
71
     * @param string $email
72
     */
73 6
    public function __construct($firstName, $lastName, $email)
74
    {
75 6
        $this->firstName = $firstName;
76 6
        $this->lastName  = $lastName;
77 6
        $this->email     = $email;
78 6
    }
79
80
    /**
81
     * @return string
82
     */
83 1
    public function __toString()
84
    {
85 1
        return $this->email;
86
    }
87
88
    /**
89
     * Get full name
90
     *
91
     * @return string
92
     */
93 1
    public function getName()
94
    {
95 1
        return $this->firstName . ' ' . $this->lastName;
96
    }
97
98
    /**
99
     * Get first name
100
     *
101
     * @return string
102
     */
103
    public function getFirstName()
104
    {
105
        return $this->firstName;
106
    }
107
108
    /**
109
     * Get last name
110
     *
111
     * @return string
112
     */
113
    public function getLastName()
114
    {
115
        return $this->lastName;
116
    }
117
118
    /**
119
     * Get email
120
     *
121
     * @return string
122
     */
123
    public function getEmail()
124
    {
125
        return $this->email;
126
    }
127
128
    /**
129
     * @return bool
130
     * @throws Exception: should be called on children classes
131
     */
132 1
    public function isACustomer()
133
    {
134 1
        throw new LogicException("This function should never be called on a user");
135
    }
136
}
137