Issues (71)

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.

src/Wizard/EntityBrowserWizard.php (3 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 Drupal\entity_browser\Wizard;
4
5
use Drupal\Core\DependencyInjection\ClassResolverInterface;
6
use Drupal\Core\Entity\EntityManagerInterface;
7
use Drupal\Core\Form\FormBuilderInterface;
8
use Drupal\Core\Routing\RouteMatchInterface;
9
use Drupal\ctools\Wizard\EntityFormWizardBase;
10
use Drupal\entity_browser\Form\DisplayConfig;
11
use Drupal\entity_browser\Form\GeneralInfoConfig;
12
use Drupal\entity_browser\Form\SelectionDisplayConfig;
13
use Drupal\entity_browser\Form\WidgetsConfig;
14
use Drupal\entity_browser\Form\WidgetSelectorConfig;
15
use Drupal\user\SharedTempStoreFactory;
16
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
17
18
/**
19
 * Custom form wizard for entity browser configuration.
20
 */
21
class EntityBrowserWizard extends EntityFormWizardBase {
22
23
  /**
24
   * @param \Drupal\user\SharedTempStoreFactory $tempstore
25
   *   Tempstore Factory for keeping track of values in each step of the
26
   *   wizard.
27
   * @param \Drupal\Core\Form\FormBuilderInterface $builder
28
   *   The Form Builder.
29
   * @param \Drupal\Core\DependencyInjection\ClassResolverInterface $class_resolver
30
   *   The class resolver.
31
   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
32
   *   The event dispatcher.
33
   * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
34
   *   The entity manager.
35
   * @param $tempstore_id
36
   *   The shared temp store factory collection name.
37
   * @param null $machine_name
0 ignored issues
show
There is no parameter named $machine_name. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
38
   *   The SharedTempStore key for our current wizard values.
39
   * @param null $step
40
   *   The current active step of the wizard.
41
   */
42
  public function __construct(SharedTempStoreFactory $tempstore, FormBuilderInterface $builder, ClassResolverInterface $class_resolver, EventDispatcherInterface $event_dispatcher, EntityManagerInterface $entity_manager, RouteMatchInterface $route_match, $tempstore_id, $entity_browser = NULL, $step = 'general') {
43
    parent::__construct($tempstore, $builder, $class_resolver, $event_dispatcher, $entity_manager, $route_match, $tempstore_id, $entity_browser, $step);
44
  }
45
46
  /**
47
   * {@inheritdoc}
48
   */
49 View Code Duplication
  public function getNextParameters($cached_values) {
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
50
    $parameters = parent::getNextParameters($cached_values);
51
    $parameters['entity_browser'] = $parameters['machine_name'];
52
    unset($parameters['machine_name']);
53
    return $parameters;
54
  }
55
56
  /**
57
   * {@inheritdoc}
58
   */
59 View Code Duplication
  public function getPreviousParameters($cached_values) {
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
60
    $parameters = parent::getPreviousParameters($cached_values);
61
    $parameters['entity_browser'] = $parameters['machine_name'];
62
    unset($parameters['machine_name']);
63
    return $parameters;
64
  }
65
66
  /**
67
   * {@inheritdoc}
68
   */
69
  public function getWizardLabel() {
70
    return $this->t('Entity browser');
71
  }
72
73
  /**
74
   * {@inheritdoc}
75
   */
76
  public function getMachineLabel() {
77
    return $this->t('Label');
78
  }
79
80
  /**
81
   * {@inheritdoc}
82
   */
83
  public function getEntityType() {
84
    return 'entity_browser';
85
  }
86
87
  /**
88
   * {@inheritdoc}
89
   */
90
  public function exists() {
91
    return 'Drupal\entity_browser\Entity\EntityBrowser::load';
92
  }
93
94
  /**
95
   * {@inheritdoc}
96
   */
97
  public function getOperations($cached_values) {
98
    return [
99
      'general' => [
100
        'title' => $this->t('General information'),
101
        'form' => GeneralInfoConfig::class,
102
      ],
103
      'display' => [
104
        'title' => $this->t('Display'),
105
        'form' => DisplayConfig::class,
106
      ],
107
      'widget_selector' => [
108
        'title' => $this->t('Widget selector'),
109
        'form' => WidgetSelectorConfig::class,
110
      ],
111
      'selection_display' => [
112
        'title' => $this->t('Selection display'),
113
        'form' => SelectionDisplayConfig::class,
114
      ],
115
      'widgets' => [
116
        'title' => $this->t('Widgets'),
117
        'form' => WidgetsConfig::class,
118
      ],
119
    ];
120
  }
121
122
}
123