Issues (48)

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/ViewHelpers/SlotViewHelper.php (1 issue)

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
/*
3
 * 2017 Romain CANON <[email protected]>
4
 *
5
 * This file is part of the TYPO3 FormZ project.
6
 * It is free software; you can redistribute it and/or modify it
7
 * under the terms of the GNU General Public License, either
8
 * version 3 of the License, or any later version.
9
 *
10
 * For the full copyright and license information, see:
11
 * http://www.gnu.org/licenses/gpl-3.0.html
12
 */
13
14
namespace Romm\Formz\ViewHelpers;
15
16
use Romm\Formz\Core\Core;
17
use Romm\Formz\Exceptions\ContextNotFoundException;
18
use Romm\Formz\Service\ViewHelper\Field\FieldViewHelperService;
19
use Romm\Formz\Service\ViewHelper\Slot\SlotViewHelperService;
20
use TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface;
21
use TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface;
22
23
/**
24
 * This view helper registers a slot which will not be rendered directly, but
25
 * with the usage of the `slot.render` view helper.
26
 *
27
 * It is used to manage dynamic parts of the layouts used with the `field` view
28
 * helper: every layout can call as many slots as it needs, and this slots must
29
 * then be registered using this view helper.
30
 */
31
class SlotViewHelper extends AbstractViewHelper implements CompilableInterface
32
{
33
    /**
34
     * @inheritdoc
35
     */
36
    public function initializeArguments()
37
    {
38
        parent::initializeArguments();
39
40
        $this->registerArgument('name', 'string', 'Name of the slot.', true);
41
        $this->registerArgument('arguments', 'array', 'Arguments sent to the slot.', false, []);
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47
    public function render()
48
    {
49
        return self::renderStatic($this->arguments, $this->buildRenderChildrenClosure(), $this->renderingContext);
0 ignored issues
show
$this->renderingContext of type object<TYPO3Fluid\Fluid\...deringContextInterface> is not a sub-type of object<TYPO3\CMS\Fluid\C...deringContextInterface>. It seems like you assume a child interface of the interface TYPO3Fluid\Fluid\Core\Re...nderingContextInterface to be always present.

This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.

Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.

Loading history...
50
    }
51
52
    /**
53
     * @inheritdoc
54
     */
55
    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
56
    {
57
        /** @var FieldViewHelperService $fieldService */
58
        $fieldService = Core::instantiate(FieldViewHelperService::class);
59
60
        if (false === $fieldService->fieldContextExists()) {
61
            throw ContextNotFoundException::slotViewHelperFieldContextNotFound();
62
        }
63
64
        /** @var SlotViewHelperService $slotService */
65
        $slotService = Core::instantiate(SlotViewHelperService::class);
66
67
        $slotService->addSlot($arguments['name'], $renderChildrenClosure, $arguments['arguments']);
68
    }
69
}
70