Issues (21)

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.

src/Badoo/LiveProfilerUI/LiveProfilerUI.php (1 issue)

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 declare(strict_types=1);
2
3
/**
4
 * @maintainer Timur Shagiakhmetov <[email protected]>
5
 */
6
7
namespace Badoo\LiveProfilerUI;
8
9
use Badoo\LiveProfilerUI\DataProviders\Interfaces\JobInterface;
10
use Badoo\LiveProfilerUI\DataProviders\Interfaces\SnapshotInterface;
11
use Badoo\LiveProfilerUI\Interfaces\StorageInterface;
12
use Psr\Log\LoggerInterface;
13
use Symfony\Component\DependencyInjection\Container;
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\Config\FileLocator;
16
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
17
18
class LiveProfilerUI
19
{
20
    /** @var Container|null */
21
    protected $Container;
22
23
    /**
24
     * @return Container
25
     * @throws \Exception
26
     */
27 2
    public function getContainer() : Container
28
    {
29 2
        if (null === $this->Container) {
30 2
            $this->Container = new ContainerBuilder();
0 ignored issues
show
Documentation Bug introduced by
It seems like new \Symfony\Component\D...tion\ContainerBuilder() of type object<Symfony\Component...ction\ContainerBuilder> is incompatible with the declared type object<Symfony\Component...jection\Container>|null of property $Container.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
31 2
            $env_config_path = getenv('AGGREGATOR_CONFIG_PATH');
32 2
            $config_path = !empty($env_config_path) && file_exists($env_config_path)
33 1
                ? $env_config_path
34 2
                : __DIR__ . '/../../config/services.yaml';
35 2
            $DILoader = new YamlFileLoader($this->Container, new FileLocator(\dirname($config_path)));
36 2
            $DILoader->load(basename($config_path));
37
        }
38
39 2
        return $this->Container;
40
    }
41
42
    /**
43
     * @param string $page_name
44
     * @return object
45
     * @throws \Exception
46
     */
47
    public function getPage(string $page_name)
48
    {
49
        try {
50
            if (!$this->getContainer()->has($page_name)) {
51
                throw new \InvalidArgumentException('Page not found');
52
            }
53
54
            return $this->getContainer()->get($page_name);
55
        } catch (\Throwable $Ex) {
56
            echo $this->getContainer()
57
                ->get('view')
58
                ->fetchFile('error', ['error' => $Ex->getMessage()]);
59
            exit;
60
        }
61
    }
62
63
    /**
64
     * @return Aggregator
65
     * @throws \Exception
66
     */
67
    public function getAggregator() : Aggregator
68
    {
69
        /** @var Aggregator $Aggregator */
70
        $Aggregator = $this->getContainer()->get('aggregator');
71
72
        return $Aggregator;
73
    }
74
75
    /**
76
     * @return StorageInterface
77
     * @throws \Exception
78
     */
79
    public function getSourceStorage() : StorageInterface
80
    {
81
        /** @var StorageInterface $Storage */
82
        $Storage = $this->getContainer()->get('source_storage');
83
84
        return $Storage;
85
    }
86
87
    /**
88
     * @return StorageInterface
89
     * @throws \Exception
90
     */
91
    public function getAggregatorStorage() : StorageInterface
92
    {
93
        /** @var StorageInterface $Storage */
94
        $Storage = $this->getContainer()->get('aggregator_storage');
95
96
        return $Storage;
97
    }
98
99
    /**
100
     * @return SnapshotInterface
101
     * @throws \Exception
102
     */
103
    public function getSnapshotDataProvider() : SnapshotInterface
104
    {
105
        /** @var SnapshotInterface $SnapshotDataProvider */
106
        $SnapshotDataProvider = $this->getContainer()->get('snapshot');
107
108
        return $SnapshotDataProvider;
109
    }
110
111
    /**
112
     * @return JobInterface
113
     * @throws \Exception
114
     */
115
    public function getJobDataProvider() : JobInterface
116
    {
117
        /** @var JobInterface $JobDataProvider */
118
        $JobDataProvider = $this->getContainer()->get('job');
119
120
        return $JobDataProvider;
121
    }
122
123
    /**
124
     * @return LoggerInterface
125
     * @throws \Exception
126
     */
127
    public function getLogger() : LoggerInterface
128
    {
129
        /** @var LoggerInterface $Logger */
130
        $Logger = $this->getContainer()->get('logger');
131
132
        return $Logger;
133
    }
134
135
    /**
136
     * @return FieldList
137
     * @throws \Exception
138
     */
139
    public function getFieldService() : FieldList
140
    {
141
        /** @var FieldList $FieldList */
142
        $FieldList = $this->getContainer()->get('fields');
143
144
        return$FieldList;
145
    }
146
147
    /**
148
     * @return string
149
     * @throws \Exception
150
     */
151
    public function getCallsCountField() : string
152
    {
153
        return $this->getContainer()->getParameter('aggregator.calls_count_field');
154
    }
155
156
    /**
157
     * @return string
158
     * @throws \Exception
159
     */
160
    public function getDefaultApp() : string
161
    {
162
        return $this->getContainer()->getParameter('aggregator.default_app');
163
    }
164
165
    /**
166
     * @return bool
167
     * @throws \Exception
168
     */
169
    public function isUseJobsInAggregation() : bool
170
    {
171
        return (bool)$this->getContainer()->getParameter('aggregator.use_jobs_in_aggregation');
172
    }
173
174
    /**
175
     * @return string
176
     * @throws \Exception
177
     */
178
    public function getAggregatingJobsLockFile() : string
179
    {
180
        return (string)$this->getContainer()->getParameter('aggregator.aggregating_jobs_lock_file');
181
    }
182
}
183