Issues (106)

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.

Classes/ReportsConfigurationStatus.php (2 issues)

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 AOE\Languagevisibility;
4
5
/***************************************************************
6
*  Copyright notice
7
*
8
*  (c) 2010 AOE Dev <[email protected]>
9
*  All rights reserved
10
*
11
*  This script is part of the TYPO3 project. The TYPO3 project is
12
*  free software; you can redistribute it and/or modify
13
*  it under the terms of the GNU General Public License as published by
14
*  the Free Software Foundation; either version 2 of the License, or
15
*  (at your option) any later version.
16
*
17
*  The GNU General Public License can be found at
18
*  http://www.gnu.org/copyleft/gpl.html.
19
*
20
*  This script is distributed in the hope that it will be useful,
21
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
22
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
*  GNU General Public License for more details.
24
*
25
*  This copyright notice MUST APPEAR in all copies of the script!
26
***************************************************************/
27
28
use TYPO3\CMS\Core\Utility\GeneralUtility;
29
30
/**
31
 * Class tx_languagevisibility_reports_ConfigurationStatus
32
 *
33
 * @package AOE\Languagevisibility\Reports
34
 */
35
class ReportsConfigurationStatus implements \TYPO3\CMS\Reports\StatusProviderInterface {
36
37
	/**
38
	 * Determines the Install Tool's status, mainly concerning its protection.
39
	 *
40
	 * @return	array	List of statuses
41
	 * @see typo3/sysext/reports/interfaces/tx_reports_StatusProvider::getStatus()
42
	 */
43
	public function getStatus() {
44
		$statuses = array(
45
			'LangMode' => $this->getLangModes(),
46
		);
47
48
		return $statuses;
49
	}
50
51
	/**
52
	 * Check all "root" sys_templates and try to find the value for config.sys_language_mode
53
	 */
54
	public function getLangModes() {
55
		$message  = '';
56
		$checked = array(
57
			'ok' => array(),
58
			'fail' => array(),
59
		);
60
		$value = $GLOBALS['LANG']->sL('LLL:EXT:languagevisibility/locallang_db.xml:reports.ok.value');
61
		$severity = \TYPO3\CMS\Reports\Status::OK;
62
63
		$rootTpls = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('sys_template', 'root', '1', '', 'pid');
0 ignored issues
show
Deprecated Code introduced by
The method TYPO3\CMS\Backend\Utilit...ty::getRecordsByField() has been deprecated with message: since TYPO3 v8, will be removed in TYPO3 v9

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
64
65
		foreach ($rootTpls as $tpl) {
66
			/**
67
			 * @var \TYPO3\CMS\Core\TypoScript\ExtendedTemplateService
68
			 */
69
			$tmpl = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\ExtendedTemplateService');
70
			$tmpl->tt_track = 0;
71
			$tmpl->init();
72
73
			// Gets the rootLine
74
			$sys_page = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
75
			$rootLine = $sys_page->getRootLine($tpl['pid']);
76
			$tmpl->runThroughTemplates($rootLine, $tpl['uid']);
77
78
			$tplRow = $tmpl->ext_getFirstTemplate($tpl['pid'], $tpl['uid']);
0 ignored issues
show
$tplRow is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
79
			$tmpl->generateConfig();
80
81
			if (!isset($tmpl->setup['config.']['sys_language_mode']) || $tmpl->setup['config.']['sys_language_mode'] != 'ignore') {
82
				$checked['fail'][] = array($tpl['pid'], $tpl['uid'], $tmpl->setup['config.']['sys_language_mode']);
83
			}
84
		}
85
86
		if (count($checked['fail'])) {
87
			$severity = \TYPO3\CMS\Reports\Status::WARNING;
88
			$value = $GLOBALS['LANG']->sL('LLL:EXT:languagevisibility/locallang_db.xml:reports.fail.value');
89
			$message .= $GLOBALS['LANG']->sL('LLL:EXT:languagevisibility/locallang_db.xml:reports.fail.message') . '<br/>';
90
			foreach ($checked['fail'] as $fail) {
91
				$message .= vsprintf($GLOBALS['LANG']->sL('LLL:EXT:languagevisibility/locallang_db.xml:reports.fail.message.detail'), $fail) . '<br />';
92
			}
93
		}
94
95
		return GeneralUtility::makeInstance('TYPO3\\CMS\\Reports\\Status',
96
			'EXT:languagevisibility config.sys_language_mode',
97
			$value,
98
			$message,
99
			$severity
100
		);
101
	}
102
}
103
104
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/languagevisibility/classes/class.tx_languagevisibility_reports_ConfigurationStatus.php'])	{
105
	include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/languagevisibility/classes/class.tx_languagevisibility_reports_ConfigurationStatus.php']);
106
}
107