Issues (3099)

Security Analysis    not enabled

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/Kunstmaan/RedirectBundle/Entity/Redirect.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 Kunstmaan\RedirectBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Kunstmaan\AdminBundle\Entity\AbstractEntity;
7
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
8
use Symfony\Component\Validator\Constraints as Assert;
9
use Symfony\Component\Validator\Context\ExecutionContextInterface;
10
11
/**
12
 * @ORM\Table(
13
 *     name="kuma_redirects",
14
 *     uniqueConstraints={
15
 *         @ORM\UniqueConstraint(name="kuma_redirects_idx_domain_origin", columns={"domain", "origin"})
16
 *     }
17
 * )
18
 * @ORM\Entity(repositoryClass="Kunstmaan\RedirectBundle\Repository\RedirectRepository")
19
 * @UniqueEntity(fields={"origin", "domain"})
20
 */
21
class Redirect extends AbstractEntity
22
{
23
    /**
24
     * @var string
25
     *
26
     * @ORM\Column(name="domain", type="string", length=255, nullable=true)
27
     */
28
    private $domain;
29
30
    /**
31
     * @var string
32
     *
33
     * @ORM\Column(name="origin", type="string", length=255)
34
     * @Assert\NotBlank()
35
     */
36
    private $origin;
37
38
    /**
39
     * @var string
40
     *
41
     * @ORM\Column(name="note", type="string", length=255, nullable=true)
42
     */
43
    private $note;
44
45
    /**
46
     * @var string
47
     *
48
     * @ORM\Column(name="target", type="text")
49
     * @Assert\NotBlank()
50
     */
51
    private $target;
52
53
    /**
54
     * @var bool
55
     *
56
     * @ORM\Column(name="permanent", type="boolean")
57
     */
58
    private $permanent;
59
60
    /**
61
     * Get domain
62
     *
63
     * @return string
64
     */
65 4
    public function getDomain()
66
    {
67 4
        return $this->domain;
68
    }
69
70
    /**
71
     * Set domain
72
     *
73
     * @param string $domain
74
     *
75
     * @return Redirect
76
     */
77 6
    public function setDomain($domain)
78
    {
79 6
        $this->domain = $domain;
80
81 6
        return $this;
82
    }
83
84
    /**
85
     * Set origin
86
     *
87
     * @param string $origin
88
     *
89
     * @return Redirect
90
     */
91 8
    public function setOrigin($origin)
92
    {
93 8
        $this->origin = $origin;
94
95 8
        return $this;
96
    }
97
98
    /**
99
     * Get origin
100
     *
101
     * @return string
102
     */
103 6
    public function getOrigin()
104
    {
105 6
        return $this->origin;
106
    }
107
108
    /**
109
     * Set target
110
     *
111
     * @param string $target
112
     *
113
     * @return Redirect
114
     */
115 8
    public function setTarget($target)
116
    {
117 8
        $this->target = $target;
118
119 8
        return $this;
120
    }
121
122
    /**
123
     * Get target
124
     *
125
     * @return string
126
     */
127 6
    public function getTarget()
128
    {
129 6
        return $this->target;
130
    }
131
132
    /**
133
     * Set permanent
134
     *
135
     * @param bool $permanent
136
     *
137
     * @return Redirect
138
     */
139 6
    public function setPermanent($permanent)
140
    {
141 6
        $this->permanent = $permanent;
142
143 6
        return $this;
144
    }
145
146
    /**
147
     * Get permanent
148
     *
149
     * @return bool
150
     */
151 4
    public function isPermanent()
152
    {
153 4
        return $this->permanent;
154
    }
155
156
    /**
157
     * @return string
158
     */
159
    public function getNote()
160
    {
161
        return $this->note;
162
    }
163
164
    /**
165
     * @param string $note
166
     *
167
     * @return Redirect
0 ignored issues
show
Should the return type not be Redirect|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...
168
     */
169
    public function setNote($note)
170
    {
171
        $this->note = $note;
172
    }
173
174
    /**
175
     * @Assert\Callback
176
     *
177
     * @param ExecutionContextInterface $context
178
     */
179 2
    public function validate(ExecutionContextInterface $context)
180
    {
181 2
        if ($this->getOrigin() === $this->getTarget()) {
182 1
            $context->buildViolation('errors.redirect.origin_same_as_target')
183 1
                ->atPath('target')
184 1
                ->addViolation();
185
        }
186 2
    }
187
}
188