Issues (292)

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.

Authorization/UI/API/Controllers/Controller.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
2
3
namespace App\Containers\Authorization\UI\API\Controllers;
4
5
use Apiato\Core\Foundation\Facades\Apiato;
6
use App\Containers\Authorization\UI\API\Requests\AssignUserToRoleRequest;
7
use App\Containers\Authorization\UI\API\Requests\AttachPermissionToRoleRequest;
8
use App\Containers\Authorization\UI\API\Requests\CreateRoleRequest;
9
use App\Containers\Authorization\UI\API\Requests\DeleteRoleRequest;
10
use App\Containers\Authorization\UI\API\Requests\DetachPermissionToRoleRequest;
11
use App\Containers\Authorization\UI\API\Requests\FindPermissionRequest;
12
use App\Containers\Authorization\UI\API\Requests\FindRoleRequest;
13
use App\Containers\Authorization\UI\API\Requests\GetAllPermissionsRequest;
14
use App\Containers\Authorization\UI\API\Requests\GetAllRolesRequest;
15
use App\Containers\Authorization\UI\API\Requests\RevokeUserFromRoleRequest;
16
use App\Containers\Authorization\UI\API\Requests\SyncPermissionsOnRoleRequest;
17
use App\Containers\Authorization\UI\API\Requests\SyncUserRolesRequest;
18
use App\Containers\Authorization\UI\API\Transformers\PermissionTransformer;
19
use App\Containers\Authorization\UI\API\Transformers\RoleTransformer;
20
use App\Containers\User\UI\API\Transformers\UserTransformer;
21
use App\Ship\Parents\Controllers\ApiController;
22
use App\Ship\Transporters\DataTransporter;
23
24
/**
25
 * Class Controller.
26
 *
27
 * @author Mahmoud Zalt <[email protected]>
28
 */
29
class Controller extends ApiController
30
{
31
32
    /**
33
     * @param \App\Containers\Authorization\UI\API\Requests\GetAllPermissionsRequest $request
34
     *
35
     * @return  mixed
36
     */
37
    public function getAllPermissions(GetAllPermissionsRequest $request)
38
    {
39
        $permissions = Apiato::call('[email protected]');
40
41
        return $this->transform($permissions, PermissionTransformer::class);
42
    }
43
44
    /**
45
     * @param \App\Containers\Authorization\UI\API\Requests\FindPermissionRequest $request
46
     *
47
     * @return  mixed
48
     */
49
    public function findPermission(FindPermissionRequest $request)
50
    {
51
        $permission = Apiato::call('[email protected]', [new DataTransporter($request)]);
52
53
        return $this->transform($permission, PermissionTransformer::class);
54
    }
55
56
    /**
57
     * @param \App\Containers\Authorization\UI\API\Requests\GetAllRolesRequest $request
58
     *
59
     * @return  mixed
60
     */
61
    public function getAllRoles(GetAllRolesRequest $request)
0 ignored issues
show
The parameter $request 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...
62
    {
63
        $roles = Apiato::call('[email protected]');
64
65
        return $this->transform($roles, RoleTransformer::class);
66
    }
67
68
    /**
69
     * @param \App\Containers\Authorization\UI\API\Requests\FindRoleRequest $request
70
     *
71
     * @return  mixed
72
     */
73
    public function findRole(FindRoleRequest $request)
74
    {
75
        $role = Apiato::call('[email protected]', [new DataTransporter($request)]);
76
77
        return $this->transform($role, RoleTransformer::class);
78
    }
79
80
    /**
81
     * @param \App\Containers\Authorization\UI\API\Requests\AssignUserToRoleRequest $request
82
     *
83
     * @return  mixed
84
     */
85
    public function assignUserToRole(AssignUserToRoleRequest $request)
86
    {
87
        $user = Apiato::call('[email protected]', [new DataTransporter($request)]);
88
89
        return $this->transform($user, UserTransformer::class);
90
    }
91
92
    /**
93
     * @param \App\Containers\Authorization\UI\API\Requests\SyncUserRolesRequest $request
94
     *
95
     * @return  mixed
96
     */
97
    public function syncUserRoles(SyncUserRolesRequest $request)
98
    {
99
        $user = Apiato::call('[email protected]', [new DataTransporter($request)]);
100
101
        return $this->transform($user, UserTransformer::class);
102
    }
103
104
    /**
105
     * @param \App\Containers\Authorization\UI\API\Requests\DeleteRoleRequest $request
106
     *
107
     * @return  \Illuminate\Http\JsonResponse
108
     */
109
    public function deleteRole(DeleteRoleRequest $request)
110
    {
111
        Apiato::call('[email protected]', [new DataTransporter($request)]);
112
113
        return $this->noContent();
114
    }
115
116
    /**
117
     * @param \App\Containers\Authorization\UI\API\Requests\RevokeUserFromRoleRequest $request
118
     *
119
     * @return  mixed
120
     */
121
    public function revokeRoleFromUser(RevokeUserFromRoleRequest $request)
122
    {
123
        $user = Apiato::call('[email protected]', [new DataTransporter($request)]);
124
125
        return $this->transform($user, UserTransformer::class);
126
    }
127
128
    /**
129
     * @param \App\Containers\Authorization\UI\API\Requests\AttachPermissionToRoleRequest $request
130
     *
131
     * @return  mixed
132
     */
133
    public function attachPermissionToRole(AttachPermissionToRoleRequest $request)
134
    {
135
        $role = Apiato::call('[email protected]', [new DataTransporter($request)]);
136
137
        return $this->transform($role, RoleTransformer::class);
138
    }
139
140
    /**
141
     * @param \App\Containers\Authorization\UI\API\Requests\SyncPermissionsOnRoleRequest $request
142
     *
143
     * @return  mixed
144
     */
145
    public function syncPermissionOnRole(SyncPermissionsOnRoleRequest $request)
146
    {
147
        $role = Apiato::call('[email protected]', [new DataTransporter($request)]);
148
149
        return $this->transform($role, RoleTransformer::class);
150
    }
151
152
    /**
153
     * @param \App\Containers\Authorization\UI\API\Requests\DetachPermissionToRoleRequest $request
154
     *
155
     * @return  mixed
156
     */
157
    public function detachPermissionFromRole(DetachPermissionToRoleRequest $request)
158
    {
159
        $role = Apiato::call('[email protected]', [new DataTransporter($request)]);
160
161
        return $this->transform($role, RoleTransformer::class);
162
    }
163
164
    /**
165
     * @param \App\Containers\Authorization\UI\API\Requests\CreateRoleRequest $request
166
     *
167
     * @return  mixed
168
     */
169
    public function createRole(CreateRoleRequest $request)
170
    {
171
        $role = Apiato::call('[email protected]', [new DataTransporter($request)]);
172
173
        return $this->transform($role, RoleTransformer::class);
174
    }
175
176
}
177