Issues (45)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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/controllers/DevelController.php (12 issues)

1
<?php
2
3
namespace App\Http\Controllers;
4
5
use Illuminate\Http\Request;
0 ignored issues
show
The type Illuminate\Http\Request was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Auth, Redirect, Validator;
0 ignored issues
show
The type Redirect was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
The type Auth was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
The type Validator was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use App\User;
0 ignored issues
show
The type App\User was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Hash, Session;
9
use Bantenprov\BantenprovSso\BantenprovSso as BantenprovSso;
10
11
12
class DevelController extends Controller
0 ignored issues
show
The type App\Http\Controllers\Controller was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
{
14
    public function login()
15
    {
16
    	if(!Auth::check())
17
    	{
18
    		return view('pages.credential.login');
0 ignored issues
show
The function view was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
    		return /** @scrutinizer ignore-call */ view('pages.credential.login');
Loading history...
19
    	}
20
    	return Redirect::to('dashboard');
21
    }
22
23
    public function post_login(Request $request)
24
    {
25
    	$validator = Validator::make($request->all(), 
26
    		[
27
    			'email'			=> 'required|email',
28
    			'password'		=> 'required'
29
    		]);
30
31
    	if($validator->fails())
32
    	{
33
    		Session::flash('message', 'Data tidak boleh kosong');
34
    		return redirect()->back()
0 ignored issues
show
The function redirect was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
    		return /** @scrutinizer ignore-call */ redirect()->back()
Loading history...
35
                ->withErrors($validator)
36
                ->withInput();
37
    	}
38
    	$credential = [
39
    	'email'			=> $request->input('email'), 
40
    	'password'		=> $request->input('password'),
41
    	'ipaddress'		=> $request->input('ip1').'-'.$request->input('ip2')
42
    	];
43
44
    	//set session 
45
    	Session(['ipaddress' => $request->input('ip1').'-'.$request->input('ip2')]);
0 ignored issues
show
The function Session was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

45
    	/** @scrutinizer ignore-call */ 
46
     Session(['ipaddress' => $request->input('ip1').'-'.$request->input('ip2')]);
Loading history...
46
47
    	if(!BantenprovSso::Attempt($credential))
48
    	{
49
    		//dd(BantenprovSso::message());
50
    		Session::flash('message', 'terjadi kesalah, login tidak berhasil');
51
    		return redirect()->back()
52
                ->withErrors(BantenprovSso::message())
53
                ->withInput();
54
    	}
55
    	//dd(BantenprovSso::data());
56
    	$data = BantenprovSso::data();
57
    	//check data user pada table user 
58
    	$user = User::where('email', $data->email)
59
    			->first();
60
    	if(count($user) == 0)
61
    	{
62
    		//return 'gak ada';
63
    		//insert data user
64
    		$create_user = new User;
65
    		$create_user->email 		= $data->email;
66
    		$create_user->name 			= $data->name;
67
    		$create_user->password 		= $data->password;
68
    		$create_user->save();
69
70
    		return Self::init_login($create_user);
0 ignored issues
show
Bug Best Practice introduced by
The method App\Http\Controllers\DevelController::init_login() is not static, but was called statically. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

70
    		return Self::/** @scrutinizer ignore-call */ init_login($create_user);
Loading history...
71
    	}
72
    	else
73
    	{
74
    		return Self::init_login($user);
75
    	}
76
77
    }
78
79
    public function init_login($data)
80
    {
81
    	//login with id
82
    	//dd($data->id);
83
    	if(Auth::loginUsingId($data->id))
84
    	{
85
    		return redirect::to('dashboard');
86
87
    	}
88
    	else
89
    	{
90
    		//false
91
    		return Redirect::to('login');
92
    	}
93
94
95
    }
96
97
    public function check_logout(Request $request)
98
    {
99
    	if(BantenprovSso::check_logout(['ipaddress' => $request->input('ipaddress')]))
100
    	{
101
    		return 1;
102
    	}
103
    	else
104
    	{
105
    		return 0;
106
    	}
107
    }
108
109
    public function check_login(Request $request)
110
    {
111
    	$check = BantenprovSso::check_login(['ipaddress' => $request->input('ipaddress')]);
112
    	if(!$check)
113
    	{
114
    		return 0;
115
    	}
116
    	else
117
    	{
118
    		// cari atau simpan data baru
119
    		$teng = BantenprovSso::check_login_data();
120
    		$user_data = User::where('email', $teng->email)->first();
121
    		if(count($user_data) == 0)
122
    		{
123
    			//simpan data baru
124
    			$simpan = new User;
125
    			$simpan->email 			= $teng->email;
126
	    		$simpan->name 			= $teng->name;
127
	    		$simpan->password 		= 'bantenprov';
128
	    		$simpan->save();
129
130
	    		Auth::loginUsingId($simpan->id);
131
	    		return 1;
132
    		}
133
    		else
134
    		{
135
    			Auth::loginUsingId($user_data->id);
136
	    		return 1;
137
    		}
138
    	}
139
    }
140
141
    public function cas_logout()
142
    {
143
    	Auth::logout();
144
    	Session()->forget('ipaddress');
0 ignored issues
show
The function Session was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

144
    	/** @scrutinizer ignore-call */ 
145
     Session()->forget('ipaddress');
Loading history...
145
    	return 1;
146
    }
147
148
   	public function logout()
149
    {
150
    	Auth::logout();
151
    	BantenprovSso::Logout(['ipaddress' => Session::get('ipaddress')]);
152
    	Session()->forget('ipaddress');
0 ignored issues
show
The function Session was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

152
    	/** @scrutinizer ignore-call */ 
153
     Session()->forget('ipaddress');
Loading history...
153
    	return Redirect::to('/login');
154
    }
155
156
}
157