Issues (4)

Security Analysis    no request data  

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/Http/Controllers/AuthController.php (1 issue)

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 Cerbero\Auth\Http\Controllers;
2
3
use Cerbero\Auth\Jobs\LoginJob;
4
use Cerbero\Auth\Jobs\LogoutJob;
5
use Cerbero\Auth\Jobs\RegisterJob;
6
use Cerbero\Auth\Jobs\RecoverJob;
7
use Cerbero\Auth\Jobs\ResetJob;
8
use Cerbero\Auth\Http\Requests\LoginRequest;
9
use Cerbero\Auth\Http\Requests\RecoverRequest;
10
use Cerbero\Auth\Http\Requests\RegisterRequest;
11
use Cerbero\Auth\Http\Requests\ResetRequest;
12
use Cerbero\Auth\Services\Dispatcher\DispatcherInterface;
13
use Illuminate\Routing\Controller;
14
15
class AuthController extends Controller {
16
17
	/**
18
	 * @author	Andrea Marco Sartori
19
	 * @var		Cerbero\Auth\Services\Dispatcher\DispatcherInterface	$bus	Bus dispatcher.
20
	 */
21
	protected $bus;
22
23
	/**
24
	 * @author	Andrea Marco Sartori
25
	 * @var		array	$loginPipes	List of pipes for the login process.
26
	 */
27
	protected $loginPipes = ['DispatchEvent', 'Throttle'];
28
29
	/**
30
	 * @author	Andrea Marco Sartori
31
	 * @var		array	$logoutPipes	List of pipes for the logout process.
32
	 */
33
	protected $logoutPipes = ['DispatchEvent'];
34
35
	/**
36
	 * @author	Andrea Marco Sartori
37
	 * @var		array	$registerPipes	List of pipes for the register process.
38
	 */
39
	protected $registerPipes = ['DispatchEvent', 'Login', 'Notify', 'Hash'];
40
41
	/**
42
	 * @author	Andrea Marco Sartori
43
	 * @var		array	$recoverPipes	List of pipes for the password recover process.
44
	 */
45
	protected $recoverPipes = ['DispatchEvent', 'Notify', 'Store'];
46
47
	/**
48
	 * @author	Andrea Marco Sartori
49
	 * @var		array	$resetPipes	List of pipes for the password reset process.
50
	 */
51
	protected $resetPipes = ['DispatchEvent'];
52
	
53
	/**
54
	 * Set the dependencies.
55
	 *
56
	 * @author	Andrea Marco Sartori
57
	 * @param	Cerbero\Auth\Services\Dispatcher\DispatcherInterface	$bus
58
	 * @return	void
59
	 */
60
	public function __construct(DispatcherInterface $bus)
61
	{
62
		$this->bus = $bus;
0 ignored issues
show
Documentation Bug introduced by
It seems like $bus of type object<Cerbero\Auth\Serv...er\DispatcherInterface> is incompatible with the declared type object<Cerbero\Auth\Http...er\DispatcherInterface> of property $bus.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
63
	}
64
65
	/**
66
	 * Display the login page.
67
	 *
68
	 * @author	Andrea Marco Sartori
69
	 * @return	Illuminate\Http\Response
70
	 */
71
	public function showLogin()
72
	{
73
		$login = config('_auth.login.view');
74
75
		return view($login);
76
	}
77
78
	/**
79
	 * Log the user in.
80
	 *
81
	 * @author	Andrea Marco Sartori
82
	 * @return	Illuminate\Http\RedirectResponse
83
	 */
84
	public function login(LoginRequest $request)
85
	{
86
		$this->bus->pipeThrough($this->pipesOf('login'))->dispatchFrom(LoginJob::class, $request);
87
88
		return redirect()->route(config('_auth.login.redirect'));
89
	}
90
91
	/**
92
	 * Retrieve the pipes of a given process.
93
	 *
94
	 * @author	Andrea Marco Sartori
95
	 * @param	string	$process
96
	 * @return	array
97
	 */
98
	protected function pipesOf($process)
99
	{
100
		$Process = ucfirst($process);
101
102
		return array_map(function($pipe) use($Process)
103
		{
104
			return "Cerbero\Auth\Pipes\\{$Process}\\{$pipe}";
105
106
		}, $this->{"{$process}Pipes"});
107
	}
108
109
	/**
110
	 * Log the user out.
111
	 *
112
	 * @author	Andrea Marco Sartori
113
	 * @return	Illuminate\Http\RedirectResponse
114
	 */
115
	public function logout()
116
	{
117
		$this->bus->pipeThrough($this->pipesOf('logout'))->dispatchNow(new LogoutJob);
118
119
		return redirect()->route(config('_auth.logout.redirect'));
120
	}
121
122
	/**
123
	 * Display the registration page.
124
	 *
125
	 * @author	Andrea Marco Sartori
126
	 * @return	Illuminate\Http\Response
127
	 */
128
	public function showRegister()
129
	{
130
		$register = config('_auth.register.view');
131
132
		return view($register);
133
	}
134
135
	/**
136
	 * Register the user.
137
	 *
138
	 * @author	Andrea Marco Sartori
139
	 * @return	Illuminate\Http\RedirectResponse
140
	 */
141
	public function register(RegisterRequest $request)
142
	{
143
		$this->bus->pipeThrough($this->pipesOf('register'))->dispatchFrom(RegisterJob::class, $request);
144
145
		return redirect()->route(config('_auth.register.redirect'))->withSuccess(trans('auth::register.success'));
146
	}
147
148
	/**
149
	 * Display the recover page.
150
	 *
151
	 * @author	Andrea Marco Sartori
152
	 * @return	Illuminate\Http\Response
153
	 */
154
	public function showRecover()
155
	{
156
		$recover = config('_auth.recover.view');
157
158
		return view($recover);
159
	}
160
161
	/**
162
	 * Remember the user password.
163
	 *
164
	 * @author	Andrea Marco Sartori
165
	 * @return	Illuminate\Http\RedirectResponse
166
	 */
167
	public function recover(RecoverRequest $request)
168
	{
169
		$this->bus->pipeThrough($this->pipesOf('recover'))->dispatchFrom(RecoverJob::class, $request);
170
171
		return back()->withSuccess(trans('auth::recover.success'));
172
	}
173
174
	/**
175
	 * Display the reset page.
176
	 *
177
	 * @author	Andrea Marco Sartori
178
	 * @return	Illuminate\Http\Response
179
	 */
180
	public function showReset($token)
181
	{
182
		$reset = config('_auth.reset.view');
183
184
		return view($reset);
185
	}
186
187
	/**
188
	 * Reset the user password.
189
	 *
190
	 * @author	Andrea Marco Sartori
191
	 * @return	Illuminate\Http\RedirectResponse
192
	 */
193
	public function reset(ResetRequest $request, $token)
194
	{
195
		$this->bus->pipeThrough($this->pipesOf('reset'))->dispatchFrom(ResetJob::class, $request, compact('token'));
196
197
		return redirect()->route('login.index')->withSuccess(trans('auth::reset.success'));
198
	}
199
200
}
201