Issues (201)

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.

includes/Admin/Model/User.php (1 issue)

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
2
namespace Redaxscript\Admin\Model;
3
4
use Redaxscript\Model as BaseModel;
5
6
/**
7
 * parent class to provide the admin user model
8
 *
9
 * @since 4.0.0
10
 *
11
 * @package Redaxscript
12
 * @category Model
13
 * @author Henry Ruhs
14
 */
15
16
class User extends BaseModel\User
17
{
18
	/**
19
	 * is unique by id and user
20
	 *
21
	 * @since 4.5.0
22
	 *
23
	 * @param int $userId identifier of the user
24
	 * @param string $userUser user of the user
25
	 *
26
	 * @return bool
27
	 */
28
29
	public function isUniqueByIdAndUser(int $userId = null, string $userUser = null) : bool
30
	{
31
		return !$this->getByUser($userUser)?->id || $this->getByUser($userUser)?->id === $this->getById($userId)?->id;
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_OBJECT_OPERATOR
Loading history...
32
	}
33
34
	/**
35
	 * update the user by id and array
36
	 *
37
	 * @since 4.0.0
38
	 *
39
	 * @param int $userId identifier of the user
40
	 * @param array $updateArray array of the update
41
	 *
42
	 * @return bool
43
	 */
44
45
	public function updateByIdAndArray(int $userId = null, array $updateArray = []) : bool
46
	{
47
		return $this
48
			->query()
49
			->whereIdIs($userId)
50
			->findOne()
51
			->set($updateArray)
52
			->save();
53
	}
54
55
	/**
56
	 * update last by id
57
	 *
58
	 * @since 4.0.0
59
	 *
60
	 * @param int $userId id of the user
61
	 * @param int $date timestamp of the date
62
	 *
63
	 * @return bool
64
	 */
65
66
	public function updateLastById(int $userId = null, int $date = null) : bool
67
	{
68
		return $this
69
			->query()
70
			->whereIdIs($userId)
71
			->findOne()
72
			->set('last', $date)
73
			->save();
74
	}
75
76
	/**
77
	 * enable the user by id
78
	 *
79
	 * @since 4.0.0
80
	 *
81
	 * @param int $userId identifier of the user
82
	 *
83
	 * @return bool
84
	 */
85
86
	public function enableById(int $userId = null) : bool
87
	{
88
		return $this
89
			->query()
90
			->whereIdIs($userId)
91
			->findOne()
92
			->set('status', 1)
93
			->save();
94
	}
95
96
	/**
97
	 * disable the user by id
98
	 *
99
	 * @since 4.0.0
100
	 *
101
	 * @param int $userId identifier of the user
102
	 *
103
	 * @return bool
104
	 */
105
106
	public function disableById(int $userId = null) : bool
107
	{
108
		return $this
109
			->query()
110
			->whereIdIs($userId)
111
			->findOne()
112
			->set('status', 0)
113
			->save();
114
	}
115
116
	/**
117
	 * delete the user by id
118
	 *
119
	 * @since 4.0.0
120
	 *
121
	 * @param int $userId identifier of the user
122
	 *
123
	 * @return bool
124
	 */
125
126
	public function deleteById(int $userId = null) : bool
127
	{
128
		return $this
129
			->query()
130
			->whereIdIs($userId)
131
			->deleteMany();
132
	}
133
}
134