Issues (3882)

Security Analysis    39 potential vulnerabilities

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 (9)
Response Splitting can be used to send arbitrary responses.
  File Manipulation (2)
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 (7)
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 (13)
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 (8)
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.

app/SystemWarnings.php (2 issues)

1
<?php
2
/**
3
 * System warnings basic file.
4
 *
5
 * @package App
6
 *
7
 * @copyright YetiForce S.A.
8
 * @license   YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
9
 * @author    Mariusz Krzaczkowski <[email protected]>
10
 * @author    RadosÅ‚aw Skrzypczak <[email protected]>
11
 */
12
13
namespace App;
14
15
/**
16
 * System warnings basic class.
17
 */
18
class SystemWarnings
19
{
20
	const FOLDERS = 'app/SystemWarnings';
21
	const SELECTED_FOLDERS = ['SystemRequirements', 'YetiForce', 'Security', 'Mail'];
22 1
23
	/**
24 1
	 * Returns a list of folders warnings.
25 1
	 *
26 1
	 * @return array
27 1
	 */
28 1
	public static function getFolders()
29 1
	{
30 1
		$folders = [];
31 1
		$i = 0;
32 1
		foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(self::FOLDERS, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
33 1
			if ($item->isDir()) {
34
				$subPath = $iterator->getSubPathName();
0 ignored issues
show
The method getSubPathName() does not exist on RecursiveIteratorIterator. ( Ignorable by Annotation )

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

34
				/** @scrutinizer ignore-call */ 
35
    $subPath = $iterator->getSubPathName();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
35
				$fileName = $item->getFilename();
36 1
				$subPath = str_replace(\DIRECTORY_SEPARATOR, '/', $subPath);
37 1
				$parent = rtrim(rtrim($subPath, $fileName), '/');
38
				$folder = ['id' => $i, 'text' => Language::translate($fileName, 'Settings:SystemWarnings'), 'subPath' => $subPath, 'parent' => '#'];
39 1
				if (isset($folders[$parent])) {
40
					$folder['parent'] = $folders[$parent]['id'];
41 1
				}
42
				if (\in_array($subPath, self::SELECTED_FOLDERS)) {
43 1
					$folder['state']['selected'] = true;
44
				}
45
				$folders[$subPath] = $folder;
46
			}
47
			++$i;
48
		}
49
		return $folders;
50
	}
51
52
	/**
53
	 * Returns a list of warnings instance.
54 1
	 *
55
	 * @param array $folders
56 1
	 * @param mixed $active
57
	 *
58
	 * @return array
59 1
	 */
60 1
	public static function getWarnings($folders, $active = true)
61
	{
62 1
		if (empty($folders)) {
63 1
			return [];
64 1
		}
65 1
		if (!\is_array($folders) && 'all' === $folders) {
0 ignored issues
show
The condition is_array($folders) is always true.
Loading history...
66
			$folders = array_keys(static::getFolders());
67
		}
68 1
		$actions = [];
69 1
		foreach ($folders as $folder) {
70 1
			$dir = self::FOLDERS . '/' . $folder;
71 1
			if (!is_dir($dir)) {
72 1
				continue;
73 1
			}
74 1
			$iterator = new \DirectoryIterator($dir);
75 1
			foreach ($iterator as $item) {
76 1
				if (!$item->isDot() && !$item->isDir()) {
77 1
					$fileName = $item->getBasename('.php');
78 1
					$folder = str_replace('/', '\\', $folder);
79 1
					$className = "\\App\\SystemWarnings\\$folder\\$fileName";
80
					$instace = new $className();
81 1
					if ($instace->preProcess()) {
82 1
						$isIgnored = 2 === $instace->getStatusValue();
83
						if (!$active || !$isIgnored) {
84 1
							$instace->process();
85 1
						}
86 1
						if (!$active || (!$isIgnored && 1 !== $instace->getStatus())) {
87
							$instace->setFolder($folder);
88
							$actions[$instace->getPriority() . $fileName] = $instace;
89
						}
90
					}
91
				}
92 1
			}
93
		}
94 1
		krsort($actions);
95
96
		return $actions;
97
	}
98
}
99