Issues (36)

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.

DependencyInjection/Configuration.php (2 issues)

Labels
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
/*
4
 * This file is part of the ONGR package.
5
 *
6
 * (c) NFQ Technologies UAB <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace ONGR\ElasticsearchBundle\DependencyInjection;
13
14
use Psr\Log\LogLevel;
15
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
16
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
17
use Symfony\Component\Config\Definition\ConfigurationInterface;
18
19
class Configuration implements ConfigurationInterface
20
{
21
22
    const ONGR_CACHE_CONFIG = 'ongr.esb.cache';
23
    const ONGR_SOURCE_DIR = 'ongr.esb.source_dir';
24
    const ONGR_PROFILER_CONFIG = 'ongr.esb.profiler';
25
    const ONGR_LOGGER_CONFIG = 'ongr.esb.logger';
26
    const ONGR_ANALYSIS_CONFIG = 'ongr.esb.analysis';
27
    const ONGR_INDEXES = 'ongr.esb.indexes';
28
    const ONGR_DEFAULT_INDEX = 'ongr.esb.default_index';
29
    const ONGR_INDEXES_OVERRIDE = 'ongr.esb.indexes_override';
30
31
    public function getConfigTreeBuilder()
32
    {
33
34
        $treeBuilder = new TreeBuilder('ongr_elasticsearch');
35
36
        if (method_exists($treeBuilder, 'getRootNode')) {
37
            $rootNode = $treeBuilder->getRootNode();
38
        } else {
39
            // BC layer for symfony/config 4.1 and older
40
            $rootNode = $treeBuilder->root('ongr_elasticsearch');
0 ignored issues
show
The method root() does not seem to exist on object<Symfony\Component...on\Builder\TreeBuilder>.

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...
41
        }
42
43
        $rootNode
44
            ->children()
45
46
            ->booleanNode('cache')
47
                ->info(
48
                    'Enables the cache handler to store important data to the cache. '.
49
                    'Default value is kernel.debug parameter.'
50
                )
51
            ->end()
52
53
            ->booleanNode('profiler')
54
                ->info(
55
                    'Enables Symfony profiler for the elasticsearch queries debug.'.
56
                    'Default value is kernel.debug parameter. '
57
                )
58
            ->end()
59
60
            ->booleanNode('logger')
61
                ->defaultTrue()
62
                ->info(
63
                    'Enables executed queries logging. Log file names are the same as index.'
64
                )
65
            ->end()
66
67
            ->arrayNode('source_directories')
68
                ->prototype('scalar')->end()
69
                ->defaultValue(['/src'])
70
                ->info(
71
                    'If your project has different than `/src` source directory, or several of them,' .
72
                    'you can specify them here to look automatically for ES documents.'
73
                )
74
            ->end()
75
76
            ->arrayNode('indexes')
77
                ->defaultValue([])
78
                ->useAttributeAsKey('namespace')
79
                ->info(
80
                    'In case you want to override index settings defined in the annotation.' .
81
                    ' e.g. use env variables instead.'
82
                )
83
                ->prototype('variable')->end()
84
            ->end()
85
86
            ->append($this->getAnalysisNode())
87
88
            ->end();
89
90
        return $treeBuilder;
91
    }
92
93
    private function getAnalysisNode(): NodeDefinition
94
    {
95
        $builder = new TreeBuilder('analysis');
96
97
        if (method_exists($builder, 'getRootNode')) {
98
            $node = $builder->getRootNode();
99
        } else {
100
            // BC layer for symfony/config 4.1 and older
101
            $node = $builder->root('analysis');
0 ignored issues
show
The method root() does not seem to exist on object<Symfony\Component...on\Builder\TreeBuilder>.

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...
102
        }
103
104
105
        $node
106
            ->info('Defines analyzers, normalizers, tokenizers and filters')
107
            ->addDefaultsIfNotSet()
108
            ->children()
109
                ->arrayNode('tokenizer')
110
                    ->defaultValue([])
111
                    ->prototype('variable')->end()
112
                ->end()
113
                ->arrayNode('filter')
114
                    ->defaultValue([])
115
                    ->prototype('variable')->end()
116
                ->end()
117
                ->arrayNode('analyzer')
118
                    ->defaultValue([])
119
                    ->prototype('variable')->end()
120
                ->end()
121
                ->arrayNode('normalizer')
122
                    ->defaultValue([])
123
                    ->prototype('variable')->end()
124
                ->end()
125
                ->arrayNode('char_filter')
126
                    ->defaultValue([])
127
                    ->prototype('variable')->end()
128
                ->end()
129
            ->end();
130
131
        return $node;
132
    }
133
}
134