GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (76)

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/Flare/Admin/AdminManager.php (2 issues)

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
namespace LaravelFlare\Flare\Admin;
4
5
use Illuminate\Routing\Router;
6
use LaravelFlare\Flare\Permissions\Permissions;
7
8
class AdminManager
9
{
10
    /**
11
     * Base Class.
12
     *
13
     * The Base Class for Model Admin's
14
     */
15
    const BASE_CLASS = 'LaravelFlare\Flare\Admin\Admin';
16
17
    /**
18
     * Admin Config Key.
19
     *
20
     * Key which defined where in the Flare Admin Config to
21
     * load the Admin classes from.
22
     *
23
     * @var string
24
     */
25
    const ADMIN_KEY = 'admin';
26
27
    /**
28
     * __construct.
29
     */
30
    public function __construct()
31
    {
32
    }
33
34
    /**
35
     * Returns the array used for the Admin Menu.
36
     *
37
     * This is temporary but it shouldn't be a breaking
38
     * change when it is altered or removed.
39
     * 
40
     * @return 
41
     */
42
    public function getAdminMenu()
43
    {
44
        return $this->getAdminClasses();
45
    }
46
47
    /**
48
     * Gets Admin classes based on the current users permissions
49
     * which have been set. If a Admin class has not had the
50
     * Permissions provided, it will be displayed by default.
51
     * 
52
     * @return 
53
     */
54
    public function getAdminClasses()
55
    {
56
        $classCollection = [];
57
58
        if (!defined('static::ADMIN_KEY')) {
59
            return $classCollection;
60
        }
61
62
        $classCollection = $this->getSubAdminClasses(\Flare::config(static::ADMIN_KEY));
63
64
        return $classCollection;
65
    }
66
67
    /**
68
     * Takes an array of classes and returns the 
69
     * classes which are available with the 
70
     * current permissions/policy set.
71
     * 
72
     * @param array $classes
73
     * 
74
     * @return array
75
     */
76
    public function getSubAdminClasses(array $classes)
77
    {
78
        $classCollection = [];
79
80
        foreach ($classes as $key => $class) {
81
            if ($this->usableClass($key)) {
82
                $classCollection[] = [$key => $this->getSubAdminClasses($class)];
83
                continue;
84
            }
85
86
            if ($this->usableClass($class)) {
87
                $classCollection[] = $class;
88
                continue;
89
            }
90
        }
91
92
        return $classCollection;
93
    }
94
95
    /**
96
     * Returns an instance of the Admin.
97
     * 
98
     * @return Admin
99
     */
100
    public static function getAdminInstance()
101
    {
102
        if (!$requested = Admin::getRequested()) {
103
            return;
104
        }
105
106
        return new $requested();
107
    }
108
109
    /**
110
     * Register Admin Routes.
111
     *
112
     * Loops through all of the Admin classes in the collection
113
     * and registers their Admin Routes.
114
     */
115
    public function registerRoutes(Router $router)
0 ignored issues
show
The parameter $router 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...
116
    {
117
        $this->registerSubRoutes($this->getAdminClasses());
118
    }
119
120
    /**
121
     * Loops through an array of classes
122
     * and registers their Route recursively.
123
     * 
124
     * @param array $classes
125
     */
126
    public function registerSubRoutes(array $classes)
127
    {
128
        foreach ($classes as $key => $class) {
129
            if (is_array($class)) {
130
                if ($this->usableClass($key)) {
131
                    $this->registerAdminRoutes($key);
132
                }
133
134
                $this->registerSubRoutes($class);
135
                continue;
136
            }
137
            $this->registerAdminRoutes($class);
138
        }
139
    }
140
141
    /**
142
     * Registers an individual group of Admin routes.
143
     * 
144
     * @param string $class
145
     */
146
    public function registerAdminRoutes($class)
147
    {
148
        (new $class())->registerRoutes(app(\Illuminate\Routing\Router::class));
149
    }
150
151
    /**
152
     * Determines if a class is usable.
153
     * 
154
     * @param string $class
155
     * 
156
     * @return bool
157
     */
158
    private function usableClass($class)
159
    {
160
        if (!is_scalar($class) || !class_exists($class)) {
161
            return false;
162
        }
163
164
        if ($class == static::BASE_CLASS) {
165
            return false;
166
        }
167
168
        return true;
169
    }
170
171
    /**
172
     * Determines if a class is available for the current User.
173
     * 
174
     * @param string $class
175
     * 
176
     * @return bool
177
     */
178
    private function availableClass($class)
0 ignored issues
show
This method is not used, and could be removed.
Loading history...
179
    {
180
        if (!Permissions::check($class)) {
181
            return false;
182
        }
183
184
        return true;
185
    }
186
}
187