Issues (18)

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/Asset.php (12 issues)

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
/*
4
 * This file is part of the limit0/assets package.
5
 *
6
 * (c) Limit Zero, LLC <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Limit0\Assets;
13
14
use Symfony\Component\HttpFoundation\File\UploadedFile;
15
16
/**
17
 * An Asset model extends the functionality available in \SplFileInfo and UploadedFile
18
 *
19
 * @author  Josh Worden <[email protected]>
20
 */
21
class Asset extends UploadedFile
22
{
23
    /**
24
     * @var array
25
     */
26
    private $storageMetadata = [];
27
28
    /**
29
     * Override UploadedFile constructor
30
     */
31 11
    public function __construct()
32
    {
33 11
    }
34
35 2
    public function __toString()
36
    {
37 2
        return $this->pathname;
0 ignored issues
show
The property pathname does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
38
    }
39
40
    /**
41
     * Returns the filename property.
42
     *
43
     * @return array
44
     */
45
    public function getStorageMetadata()
46
    {
47
        return $this->storageMetadata;
48
    }
49
50
    /**
51
     * Returns the filename property.
52
     *
53
     * @return string
54
     */
55 3
    public function getFilename()
56
    {
57 3
        return $this->filename;
0 ignored issues
show
The property filename does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
58
    }
59
60
    /**
61
     * Returns the filepath property.
62
     *
63
     * @return string
64
     */
65 1
    public function getFilepath()
66
    {
67 1
        return $this->filepath;
0 ignored issues
show
The property filepath does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
68
    }
69
70
    /**
71
     * Returns the extension property.
72
     *
73
     * @return string
74
     */
75 3
    public function getExtension()
76
    {
77 3
        return $this->extension;
0 ignored issues
show
The property extension does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
78
    }
79
80
    /**
81
     * Returns the pathname property.
82
     *
83
     * @return string
84
     */
85 3
    public function getPathname()
86
    {
87 3
        return $this->pathname;
88
    }
89
90
    /**
91
     * Returns the mimeType property.
92
     *
93
     * @return string
94
     */
95 3
    public function getMimeType()
96
    {
97 3
        return $this->mimeType;
0 ignored issues
show
The property mimeType cannot be accessed from this context as it is declared private in class Symfony\Component\HttpFoundation\File\UploadedFile.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
98
    }
99
100
    /**
101
     * Returns the clientOriginalName property.
102
     *
103
     * @return string
104
     */
105 1
    public function getClientOriginalName()
106
    {
107 1
        return $this->clientOriginalName;
0 ignored issues
show
The property clientOriginalName does not seem to exist. Did you mean originalName?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
108
    }
109
110
    /**
111
     * Returns the clientOriginalExtension property.
112
     *
113
     * @return string
114
     */
115 1
    public function getClientOriginalExtension()
116
    {
117 1
        return $this->clientOriginalExtension;
0 ignored issues
show
The property clientOriginalExtension does not seem to exist. Did you mean extension?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
118
    }
119
120
    /**
121
     * Returns the clientMimeType property.
122
     *
123
     * @return string
124
     */
125 1
    public function getClientMimeType()
126
    {
127 1
        return $this->clientMimeType;
0 ignored issues
show
The property clientMimeType does not seem to exist. Did you mean mimeType?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
128
    }
129
130
    /**
131
     * Returns the filename property.
132
     *
133
     * @param  array $value
134
     * @return self
135
     */
136
    public function setStorageMetadata(array $value = [])
137
    {
138
        $this->storageMetadata = $value;
139
        return $this;
140
    }
141
142
    /**
143
     * Sets the filename property.
144
     *
145
     * @param  string $value
146
     * @return self
147
     */
148 11
    public function setFilename($value)
149
    {
150 11
        $this->filename = $value;
151 11
        return $this;
152
    }
153
154
    /**
155
     * Sets the filepath property.
156
     *
157
     * @param  string $value
158
     * @return self
159
     */
160 3
    public function setFilepath($value)
161
    {
162 3
        $this->filepath = $value;
163 3
        return $this;
164
    }
165
166
    /**
167
     * Sets the extension property.
168
     *
169
     * @param  string $value
170
     * @return self
171
     */
172 11
    public function setExtension($value)
173
    {
174 11
        $this->extension = $value;
175 11
        return $this;
176
    }
177
178
    /**
179
     * Sets the pathname property.
180
     *
181
     * @param  string $value
182
     * @return self
183
     */
184 11
    public function setPathname($value)
185
    {
186 11
        $this->pathname = $value;
187 11
        return $this;
188
    }
189
190
    /**
191
     * Sets the mimeType property.
192
     *
193
     * @param  string $value
194
     * @return self
195
     */
196 11
    public function setMimeType($value)
197
    {
198 11
        $this->mimeType = $value;
0 ignored issues
show
The property mimeType cannot be accessed from this context as it is declared private in class Symfony\Component\HttpFoundation\File\UploadedFile.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
199 11
        return $this;
200
    }
201
202
    /**
203
     * Sets the clientOriginalName property.
204
     *
205
     * @param  string $value
206
     * @return self
207
     */
208 11
    public function setClientOriginalName($value)
209
    {
210 11
        $this->clientOriginalName = $value;
0 ignored issues
show
The property clientOriginalName does not seem to exist. Did you mean originalName?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
211 11
        return $this;
212
    }
213
214
    /**
215
     * Sets the clientOriginalExtension property.
216
     *
217
     * @param  string $value
218
     * @return self
219
     */
220 11
    public function setClientOriginalExtension($value)
221
    {
222 11
        $this->clientOriginalExtension = $value;
0 ignored issues
show
The property clientOriginalExtension does not seem to exist. Did you mean extension?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
223 11
        return $this;
224
    }
225
226
    /**
227
     * Sets the clientMimeType property.
228
     *
229
     * @param  string $value
230
     * @return self
231
     */
232 1
    public function setClientMimeType($value)
233
    {
234 1
        $this->clientMimeType = $value;
0 ignored issues
show
The property clientMimeType does not seem to exist. Did you mean mimeType?

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
235 1
        return $this;
236
    }
237
}
238