Issues (29)

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.

Repositories/Usher/UsherAuthentication.php (3 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 namespace Modules\User\Repositories\Usher;
2
3
use Illuminate\Contracts\Auth\Guard;
4
use Modules\Core\Contracts\Authentication;
5
use Modules\User\Repositories\UserRepository;
6
7
class UsherAuthentication implements Authentication
0 ignored issues
show
There is one abstract method id in this class; you could implement it, or declare this class as abstract.
Loading history...
8
{
9
    /**
10
     * @var Guard
11
     */
12
    private $guard;
13
14
    /**
15
     * @var UserRepository
16
     */
17
    private $repository;
18
19
    /**
20
     * @param Guard          $guard
21
     * @param UserRepository $repository
22
     */
23
    public function __construct(Guard $guard, UserRepository $repository)
24
    {
25
        $this->guard = $guard;
26
        $this->repository = $repository;
27
    }
28
29
    /**
30
     * Authenticate a user
31
     * @param  array $credentials
32
     * @param  bool  $remember Remember the user
33
     * @return mixed
34
     */
35
    public function login(array $credentials, $remember = false)
36
    {
37
        return $this->guard->attempt($credentials, $remember);
38
    }
39
40
    /**
41
     * Register a new user.
42
     * @param  array $user
43
     * @return bool
44
     */
45
    public function register(array $user)
46
    {
47
        return $this->repository->create((array) $user);
48
    }
49
50
    /**
51
     * Assign a role to the given user.
52
     * @param  \Modules\User\Repositories\UserRepository $user
53
     * @param  \Modules\User\Repositories\RoleRepository $role
54
     * @return mixed
55
     */
56
    public function assignRole($user, $role)
57
    {
58
        return $user->assignRole($role);
0 ignored issues
show
The method assignRole() does not seem to exist on object<Modules\User\Repositories\UserRepository>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
59
    }
60
61
    /**
62
     * Log the user out of the application.
63
     * @return bool
64
     */
65
    public function logout()
66
    {
67
        return $this->guard->logout();
68
    }
69
70
    /**
71
     * Activate the given used id
72
     * @param  int    $userId
73
     * @param  string $code
74
     * @return mixed
75
     */
76
    public function activate($userId, $code)
77
    {
78
        // TODO
79
    }
80
81
    /**
82
     * Create an activation code for the given user
83
     * @param  \Modules\User\Repositories\UserRepository $user
84
     * @return mixed
85
     */
86
    public function createActivation($user)
87
    {
88
        // TODO
89
    }
90
91
    /**
92
     * Create a reminders code for the given user
93
     * @param  \Modules\User\Repositories\UserRepository $user
94
     * @return mixed
95
     */
96
    public function createReminderCode($user)
97
    {
98
        // TODO
99
    }
100
101
    /**
102
     * Completes the reset password process
103
     * @param         $user
104
     * @param  string $code
105
     * @param  string $password
106
     * @return bool
107
     */
108
    public function completeResetPassword($user, $code, $password)
109
    {
110
        // TODO
111
    }
112
113
    /**
114
     * Determines if the current user has access to given permission
115
     * @param $permission
116
     * @return bool
117
     */
118
    public function hasAccess($permission)
119
    {
120
        return $this->guard->user()->hasAccess($permission);
0 ignored issues
show
The method hasAccess() does not seem to exist on object<Illuminate\Contracts\Auth\Authenticatable>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
121
    }
122
123
    /**
124
     * Check if the user is logged in
125
     * @return mixed
126
     */
127
    public function check()
128
    {
129
        return $this->guard->user();
130
    }
131
}
132