Issues (964)

Security Analysis    not enabled

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.

testdata/mymodule3/class/Permissionshandler.php (4 issues)

Labels
Severity
1
<?php
2
3
namespace XoopsModules\Mymodule3;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
*/
14
15
/**
16
 * My Module 3 module for xoops
17
 *
18
 * @copyright     2020 XOOPS Project (https://xooops.org)
19
 * @license        GPL 2.0 or later
20
 * @package        mymodule3
21
 * @since          1.0
22
 * @min_xoops      2.5.9
23
 * @author         TDM XOOPS - Email:<[email protected]> - Website:<http://xoops.org>
24
 */
25
26
use XoopsModules\Mymodule3;
27
28
defined('XOOPS_ROOT_PATH') || die('Restricted access');
29
30
/**
31
 * Class Object Permissionshandler
32
 */
33
class Permissionshandler extends \XoopsPersistableObjectHandler
34
{
35
	/**
36
	 * Constructor 
37
	 *
38
	 * @param null
39
	 */
40
	public function __construct()
41
	{
42
	}
43
44
	/**
45
	 * @public function permGlobalApprove
46
	 * returns right for global approve
47
	 *
48
	 * @param null
49
	 * @return bool
50
	 */
51
	public function getPermGlobalApprove()
52
	{
53
		global $xoopsUser, $xoopsModule;
54
		$currentuid = 0;
55
		if (isset($xoopsUser) && is_object($xoopsUser)) {
56
			if ($xoopsUser->isAdmin($xoopsModule->mid())) {
57
				return true;
58
			}
59
			$currentuid = $xoopsUser->uid();
60
		}
61
		$grouppermHandler = xoops_getHandler('groupperm');
62
		$mid = $xoopsModule->mid();
63
		$memberHandler = xoops_getHandler('member');
64
		if (0 == $currentuid) {
65
			$my_group_ids = [XOOPS_GROUP_ANONYMOUS];
66
		} else {
67
			$my_group_ids = $memberHandler->getGroupsByUser($currentuid);;
0 ignored issues
show
The method getGroupsByUser() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsMembershipHandler or XoopsPersistableObjectHandler. ( Ignorable by Annotation )

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

67
			/** @scrutinizer ignore-call */ 
68
   $my_group_ids = $memberHandler->getGroupsByUser($currentuid);;
Loading history...
68
		}
69
		if ($grouppermHandler->checkRight('mymodule3_ac', 4, $my_group_ids, $mid)) {
0 ignored issues
show
The method checkRight() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsGroupPermHandler or XoopsPersistableObjectHandler. ( Ignorable by Annotation )

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

69
		if ($grouppermHandler->/** @scrutinizer ignore-call */ checkRight('mymodule3_ac', 4, $my_group_ids, $mid)) {
Loading history...
70
			return true;
71
		}
72
		return false;
73
	}
74
75
	/**
76
	 * @public function permGlobalSubmit
77
	 * returns right for global submit
78
	 *
79
	 * @param null
80
	 * @return bool
81
	 */
82
	public function getPermGlobalSubmit()
83
	{
84
		global $xoopsUser, $xoopsModule;
85
		$currentuid = 0;
86
		if (isset($xoopsUser) && is_object($xoopsUser)) {
87
			if ($xoopsUser->isAdmin($xoopsModule->mid())) {
88
				return true;
89
			}
90
			$currentuid = $xoopsUser->uid();
91
		}
92
		$grouppermHandler = xoops_getHandler('groupperm');
93
		$mid = $xoopsModule->mid();
94
		$memberHandler = xoops_getHandler('member');
95
		if (0 == $currentuid) {
96
			$my_group_ids = [XOOPS_GROUP_ANONYMOUS];
97
		} else {
98
			$my_group_ids = $memberHandler->getGroupsByUser($currentuid);;
99
		}
100
		if ($this->getGlobalApprove()) {
0 ignored issues
show
The method getGlobalApprove() does not exist on XoopsModules\Mymodule3\Permissionshandler. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

100
		if ($this->/** @scrutinizer ignore-call */ getGlobalApprove()) {
Loading history...
101
			return true;
102
		}
103
		if ($grouppermHandler->checkRight('mymodule3_ac', 8, $my_group_ids, $mid)) {
104
			return true;
105
		}
106
		return false;
107
	}
108
109
	/**
110
	 * @public function permGlobalView
111
	 * returns right for global view
112
	 *
113
	 * @param null
114
	 * @return bool
115
	 */
116
	public function getPermGlobalView()
117
	{
118
		global $xoopsUser, $xoopsModule;
119
		$currentuid = 0;
120
		if (isset($xoopsUser) && is_object($xoopsUser)) {
121
			if ($xoopsUser->isAdmin($xoopsModule->mid())) {
122
				return true;
123
			}
124
			$currentuid = $xoopsUser->uid();
125
		}
126
		$grouppermHandler = xoops_getHandler('groupperm');
127
		$mid = $xoopsModule->mid();
128
		$memberHandler = xoops_getHandler('member');
129
		if (0 == $currentuid) {
130
			$my_group_ids = [XOOPS_GROUP_ANONYMOUS];
131
		} else {
132
			$my_group_ids = $memberHandler->getGroupsByUser($currentuid);;
133
		}
134
		if ($this->getGlobalApprove()) {
135
			return true;
136
		}
137
		if ($this->getGlobalSubmit()) {
0 ignored issues
show
The method getGlobalSubmit() does not exist on XoopsModules\Mymodule3\Permissionshandler. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

137
		if ($this->/** @scrutinizer ignore-call */ getGlobalSubmit()) {
Loading history...
138
			return true;
139
		}
140
		if ($grouppermHandler->checkRight('mymodule3_ac', 16, $my_group_ids, $mid)) {
141
			return true;
142
		}
143
		return false;
144
	}
145
}
146