Issues (1704)

Branch: master

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.

Bundle/BlogBundle/Entity/ArticleTranslation.php (4 issues)

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 Victoire\Bundle\BlogBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Gedmo\Mapping\Annotation as Gedmo;
7
use JMS\Serializer\Annotation as Serializer;
8
use Knp\DoctrineBehaviors\Model\Translatable\Translation;
9
use Symfony\Component\Validator\Constraints as Assert;
10
use Victoire\Bundle\CoreBundle\Annotations as VIC;
11
use Victoire\Bundle\MediaBundle\Entity\Media;
12
13
/**
14
 * Victoire ViewTranslation.
15
 *
16
 * @ORM\Entity()
17
 * @ORM\Table(name="vic_article_translations")
18
 */
19
class ArticleTranslation
20
{
21
    use Translation;
22
23
    /**
24
     * @var string
25
     *
26
     * @Assert\NotBlank()
27
     * @ORM\Column(name="name", type="string", length=255)
28
     * @Serializer\Groups({"search"})
29
     * @VIC\BusinessProperty({"textable", "seoable"})
30
     */
31
    protected $name;
32
33
    /**
34
     * @var string
35
     *
36
     * @Assert\NotBlank(groups={"edition"})
37
     * @Gedmo\Slug(handlers={
38
     *     @Gedmo\SlugHandler(class="Victoire\Bundle\BusinessEntityBundle\Handler\TwigSlugHandler"
39
     * )},fields={"name"}, updatable=false, unique=false)
40
     * @ORM\Column(name="slug", type="string", length=255)
41
     * @VIC\BusinessProperty("businessParameter")
42
     */
43
    protected $slug;
44
45
    /**
46
     * @var string
47
     *
48
     * @ORM\ManyToOne(targetEntity="\Victoire\Bundle\MediaBundle\Entity\Media")
49
     * @ORM\JoinColumn(name="image_id", referencedColumnName="id", onDelete="CASCADE")
50
     * @VIC\BusinessProperty("imageable")
51
     */
52
    private $image;
53
54
    /**
55
     * @var string
56
     *
57
     * @ORM\Column(name="description", type="text", nullable=true)
58
     * @VIC\BusinessProperty({"textable", "seoable"})
59
     */
60
    private $description;
61
62
    /**
63
     * Get name.
64
     *
65
     * @return string
66
     */
67
    public function getName()
68
    {
69
        return $this->name;
70
    }
71
72
    /**
73
     * Set name.
74
     *
75
     * @param string $name
76
     *
77
     * @return View
78
     */
79
    public function setName($name)
80
    {
81
        $this->name = $name;
82
83
        return $this;
84
    }
85
86
    /**
87
     * Set slug.
88
     *
89
     * @param string $slug
90
     *
91
     * @return View
92
     */
93
    public function setSlug($slug)
94
    {
95
        $this->slug = $slug;
96
97
        return $this;
98
    }
99
100
    /**
101
     * Get slug.
102
     *
103
     * @return string
104
     */
105
    public function getSlug()
106
    {
107
        return $this->slug;
108
    }
109
110
    /**
111
     * Get description.
112
     *
113
     * @return string
114
     */
115
    public function getDescription()
116
    {
117
        return $this->description;
118
    }
119
120
    /**
0 ignored issues
show
Doc comment for parameter "$description" missing
Loading history...
121
     * Set category.
122
     *
123
     * @param string $category
0 ignored issues
show
There is no parameter named $category. 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...
Doc comment for parameter $category does not match actual variable name $description
Loading history...
124
     *
125
     * @return Article
126
     */
127
    public function setDescription($description)
128
    {
129
        $this->description = $description;
130
131
        return $this;
132
    }
133
134
    /**
135
     * Set image.
136
     *
137
     * @param Media $image
138
     *
139
     * @return ArticleTranslation
140
     */
141
    public function setImage(Media $image = null)
142
    {
143
        $this->image = $image;
0 ignored issues
show
Documentation Bug introduced by
It seems like $image can also be of type object<Victoire\Bundle\MediaBundle\Entity\Media>. However, the property $image is declared as type string. Maybe add an additional type check?

Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.

For example, imagine you have a variable $accountId that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to the id property of an instance of the Account class. This class holds a proper account, so the id value must no longer be false.

Either this assignment is in error or a type check should be added for that assignment.

class Id
{
    public $id;

    public function __construct($id)
    {
        $this->id = $id;
    }

}

class Account
{
    /** @var  Id $id */
    public $id;
}

$account_id = false;

if (starsAreRight()) {
    $account_id = new Id(42);
}

$account = new Account();
if ($account instanceof Id)
{
    $account->id = $account_id;
}
Loading history...
144
145
        return $this;
146
    }
147
148
    /**
149
     * Get image.
150
     *
151
     * @return string
152
     */
153
    public function getImage()
154
    {
155
        return $this->image;
156
    }
157
}
158