Issues (234)

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.

tests/Provider/FakeHttpWrapper.php (23 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
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Sonata Project package.
7
 *
8
 * (c) Thomas Rabaix <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Sonata\MediaBundle\Tests\Provider;
15
16
class FakeHttpWrapper
17
{
18
    public static $ref = [
19
        // youtube content
20
        'http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=BDYAbAtaDzA&format=json' => 'valide_youtube.txt',
21
        'http://i3.ytimg.com/vi/BDYAbAtaDzA/hqdefault.jpg' => 'logo.jpg',
22
23
        // dailymotion content
24
        'http://www.dailymotion.com/services/oembed?url=http://www.dailymotion.com/video/x9wjql&format=json' => 'valide_dailymotion.txt',
25
        'http://ak2.static.dailymotion.com/static/video/711/536/16635117:jpeg_preview_large.jpg?20100801072241' => 'logo.jpg',
26
27
        // vimeo content
28
        'http://vimeo.com/api/oembed.json?url=http://vimeo.com/BDYAbAtaDzA' => 'valide_vimeo.txt',
29
        'http://b.vimeocdn.com/ts/136/375/136375440_1280.jpg' => 'logo.jpg',
30
    ];
31
32
    /* Properties */
33
    public $context;
34
35
    public $fp;
36
37
    /* Methods */
38
    public function __construct()
39
    {
40
    }
41
42
    public function dir_closedir(): void
43
    {
44
    }
45
46
    public function dir_opendir($path, $options): void
0 ignored issues
show
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
47
    {
48
    }
49
50
    public function dir_readdir(): void
51
    {
52
    }
53
54
    public function dir_rewinddir(): void
55
    {
56
    }
57
58
    public function mkdir($path, $mode, $options): void
0 ignored issues
show
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $mode is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
59
    {
60
    }
61
62
    public function rename($path_from, $path_to): void
0 ignored issues
show
The parameter $path_from is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $path_to is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
63
    {
64
    }
65
66
    public function rmdir($path, $options): void
0 ignored issues
show
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
67
    {
68
    }
69
70
    public function stream_cast($cast_as): void
0 ignored issues
show
The parameter $cast_as is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
71
    {
72
    }
73
74
    public function stream_close(): bool
75
    {
76
        return true;
77
    }
78
79
    public function stream_eof(): bool
80
    {
81
        return 0 === feof($this->fp);
82
    }
83
84
    public function stream_flush(): void
85
    {
86
    }
87
88
    public function stream_lock($operation): void
0 ignored issues
show
The parameter $operation is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
89
    {
90
    }
91
92
    public function stream_open($path, $mode, $options, &$opened_path): bool
0 ignored issues
show
The parameter $options is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $opened_path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
93
    {
94
        $file = __DIR__.'/../fixtures/'.self::$ref[$path];
95
96
        if (!is_file($file)) {
97
            var_dump('unable to retrieve the file : '.$file);
0 ignored issues
show
Security Debugging Code introduced by
var_dump('unable to retr... the file : ' . $file); looks like debug code. Are you sure you do not want to remove it? This might expose sensitive data.
Loading history...
98
        }
99
100
        $this->fp = fopen($file, $mode);
101
102
        return true;
103
    }
104
105
    public function stream_read($count)
106
    {
107
        return fread($this->fp, $count);
108
    }
109
110
    public function stream_seek($offset, $whence = SEEK_SET): void
0 ignored issues
show
The parameter $offset is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $whence is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
111
    {
112
    }
113
114
    public function stream_set_option($option, $arg1, $arg2): void
0 ignored issues
show
The parameter $option is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $arg1 is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $arg2 is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
115
    {
116
    }
117
118
    public function stream_stat(): void
119
    {
120
    }
121
122
    public function stream_tell(): void
123
    {
124
    }
125
126
    public function stream_write($data): void
0 ignored issues
show
The parameter $data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
127
    {
128
    }
129
130
    public function unlink($path): void
0 ignored issues
show
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
131
    {
132
    }
133
134
    public function url_stat($path, $flags): void
0 ignored issues
show
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $flags is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
135
    {
136
    }
137
}
138