Issues (14)

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/Controller/Wizard/FocuspointController.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
/**
4
 * Wizard controller.
5
 */
6
7
namespace HDNET\Focuspoint\Controller\Wizard;
8
9
use HDNET\Focuspoint\Service\WizardHandler\AbstractWizardHandler;
10
use HDNET\Focuspoint\Service\WizardHandler\File;
11
use HDNET\Focuspoint\Service\WizardHandler\FileReference;
12
use HDNET\Focuspoint\Service\WizardHandler\Group;
13
use Psr\Http\Message\ResponseInterface;
14
use Psr\Http\Message\ServerRequestInterface;
15
use TYPO3\CMS\Backend\Utility\BackendUtility;
16
use TYPO3\CMS\Core\Http\HtmlResponse;
17
use TYPO3\CMS\Core\Utility\ArrayUtility;
18
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
19
use TYPO3\CMS\Core\Utility\GeneralUtility;
20
use TYPO3\CMS\Core\Utility\HttpUtility;
21
use TYPO3\CMS\Fluid\View\StandaloneView;
22
23
/**
24
 * Wizard controller.
25
 */
26
class FocuspointController
27
{
28
    /**
29
     * Main action.
30
     *
31
     * @throws \Exception
32
     *
33
     * @return string
34
     */
35
    public function main()
36
    {
37
        $handler = $this->getCurrentHandler();
38
        $parameter = GeneralUtility::_GET();
39
        if (isset($parameter['save'])) {
40
            if (\is_object($handler)) {
41
                $handler->setCurrentPoint($parameter['xValue'] * 100, $parameter['yValue'] * 100);
42
            }
43
            HttpUtility::redirect($parameter['P']['returnUrl']);
44
        }
45
        $saveArguments = [
46
            'save' => 1,
47
            'P' => [
48
                'returnUrl' => $parameter['P']['returnUrl'],
49
            ],
50
        ];
51
52
        /** @var StandaloneView $template */
53
        $template = GeneralUtility::makeInstance(StandaloneView::class);
54
        $template->setTemplatePathAndFilename(ExtensionManagementUtility::extPath(
55
            'focuspoint',
56
            'Resources/Private/Templates/Wizard/Focuspoint.html'
57
        ));
58
59
        if (\is_object($handler)) {
60
            ArrayUtility::mergeRecursiveWithOverrule($saveArguments, $handler->getArguments());
61
            list($x, $y) = $handler->getCurrentPoint();
62
            $template->assign('filePath', $handler->getPublicUrl());
63
            $template->assign('currentLeft', (($x + 100) / 2) . '%');
64
            $template->assign('currentTop', (($y - 100) / -2) . '%');
65
        }
66
67
        $template->assign('saveUri', BackendUtility::getModuleUrl('focuspoint', $saveArguments));
0 ignored issues
show
Deprecated Code introduced by
The method TYPO3\CMS\Backend\Utilit...Utility::getModuleUrl() has been deprecated with message: since TYPO3 v9, will be removed in TYPO3 v10.0. Use UriBuilder instead.

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...
68
69
        return $template->render();
70
    }
71
72
    /**
73
     * Returns the Module menu for the AJAX request.
74
     *
75
     * @param ServerRequestInterface $request
76
     * @param ResponseInterface      $response
77
     *
78
     * @return ResponseInterface
79
     */
80
    public function mainAction(ServerRequestInterface $request, ResponseInterface $response = null)
0 ignored issues
show
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
81
    {
82
        if($response === null) {
83
            $response = new HtmlResponse('');
84
        }
85
        $content = $this->main();
86
        $response->getBody()->write($content);
87
88
        return $response;
89
    }
90
91
    /**
92
     * Get the current handler.
93
     *
94
     * @return AbstractWizardHandler|null
95
     */
96
    protected function getCurrentHandler()
97
    {
98
        foreach ($this->getWizardHandler() as $handler) {
99
            /** @var $handler AbstractWizardHandler */
100
            if ($handler->canHandle()) {
101
                return $handler;
102
            }
103
        }
104
    }
105
106
    /**
107
     * Get the wizard handler.
108
     *
109
     * @return array
110
     */
111
    protected function getWizardHandler()
112
    {
113
        return [
114
            GeneralUtility::makeInstance(File::class),
115
            GeneralUtility::makeInstance(FileReference::class),
116
            GeneralUtility::makeInstance(Group::class),
117
        ];
118
    }
119
}
120