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/View/LoginForm.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
namespace Redaxscript\View;
3
4
use Redaxscript\Html;
5
use Redaxscript\Model;
6
use Redaxscript\Module;
7
use Redaxscript\Validator;
8
9
/**
10
 * children class to create the login form
11
 *
12
 * @since 3.0.0
13
 *
14
 * @package Redaxscript
15
 * @category View
16
 * @author Henry Ruhs
17
 */
18
19
class LoginForm extends ViewAbstract
20
{
21
	/**
22
	 * render the view
23
	 *
24
	 * @since 3.0.0
25
	 *
26
	 * @return string
27
	 */
28
29 1
	public function render() : string
30
	{
31 1
		$output = Module\Hook::trigger('loginFormStart');
32 1
		$outputLegend = null;
33 1
		$settingModel = new Model\Setting();
34 1
		$userValidator = new Validator\User();
35 1
		$passwordValidator = new Validator\Password();
36 1
		$parameterRoute = $this->_registry->get('parameterRoute');
37
38
		/* html element */
39
40 1
		$element = new Html\Element();
41
		$titleElement = $element
42 1
			->copy()
43 1
			->init('h2',
44
			[
45 1
				'class' => 'rs-title-content'
46
			])
47 1
			->text($this->_language->get('login'));
48 1
		if ($settingModel->get('recovery'))
0 ignored issues
show
Bug Best Practice introduced by
The expression $settingModel->get('recovery') of type string|null is loosely compared to true; this is ambiguous if the string can be empty. You might want to explicitly use !== null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
49
		{
50
			$linkElement = $element
51 1
				->copy()
52 1
				->init('a',
53
				[
54 1
					'href' => $parameterRoute . 'login/recover'
55
				]);
56 1
			$outputLegend = $linkElement->text($this->_language->get('recovery_question') . $this->_language->get('question_mark'));
57
		}
58 1
		$formElement = new Html\Form($this->_registry, $this->_language);
59 1
		$formElement->init(
60
		[
61
			'form' =>
62
			[
63 1
				'class' => 'rs-js-validate rs-form-default rs-form-login'
64
			],
65
			'button' =>
66
			[
67
				'submit' =>
68
				[
69
					'name' => self::class
70
				]
71
			]
72
		],
73
		[
74 1
			'captcha' => $settingModel->get('captcha')
75
		]);
76
77
		/* create the form */
78
79
		$formElement
80 1
			->legend($outputLegend)
81 1
			->append('<ul><li>')
82 1
			->label('* ' . $this->_language->get('user'),
83
			[
84 1
				'for' => 'user'
85
			])
86 1
			->text(
87
			[
88 1
				'autofocus' => 'autofocus',
89 1
				'id' => 'user',
90 1
				'name' => 'user',
91 1
				'pattern' => $userValidator->getPattern(),
92 1
				'required' => 'required'
93
			])
94 1
			->append('</li><li>')
95 1
			->label('* ' . $this->_language->get('password'),
96
			[
97 1
				'for' => 'password'
98
			])
99 1
			->password(
100
			[
101 1
				'id' => 'password',
102 1
				'name' => 'password',
103 1
				'pattern' => $passwordValidator->getPattern(),
104 1
				'required' => 'required'
105
			])
106 1
			->append('</li>');
107 1
		if ($settingModel->get('captcha') > 0)
108
		{
109
			$formElement
110 1
				->append('<li>')
111 1
				->captcha('task')
112 1
				->append('</li>');
113
		}
114 1
		$formElement->append('</ul>');
115 1
		if ($settingModel->get('captcha') > 0)
116
		{
117 1
			$formElement->captcha('solution');
118
		}
119
		$formElement
120 1
			->token()
121 1
			->submit();
122
123
		/* collect output */
124
125 1
		$output .= $titleElement . $formElement;
126 1
		$output .= Module\Hook::trigger('loginFormEnd');
127 1
		return $output;
128
	}
129
}
130