Issues (2687)

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/Eccube/ServiceProvider/LogServiceProvider.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
2
3
namespace Eccube\ServiceProvider;
4
5
use Eccube\EventListener\LogListener;
6
use Eccube\Log\Logger;
7
use Eccube\Log\Monolog\Helper\LogHelper;
8
use Silex\Application;
9
use Silex\ServiceProviderInterface;
10
11
/**
12
 * Class LogServiceProvider
13
 *
14
 * @package Eccube\ServiceProvider
15
 */
16
class LogServiceProvider implements ServiceProviderInterface
17
{
18 1195
    public function register(Application $app)
19
    {
20 1195
        $app->register(new \Silex\Provider\MonologServiceProvider());
21
22
        // Log
23
        $app['eccube.logger'] = $app->share(function ($app) {
24 1192
            return new Logger($app);
25 1195
        });
26
27
        // ヘルパー作成
28
        $app['eccube.monolog.helper'] = $app->share(function ($app) {
29 1193
            return new LogHelper($app);
30 1195
        });
31
32
        // ログクラス作成ファクトリー
33
        $app['eccube.monolog.factory'] = $app->protect(function (array $channelValues) use ($app) {
34
35 574
            $log = new $app['monolog.logger.class']($channelValues['name']);
0 ignored issues
show
Use parentheses when instantiating classes
Loading history...
36
37
            // EccubeMonologHelper内でHandlerを設定している
38 574
            $log->pushHandler($app['eccube.monolog.helper']->getHandler($channelValues));
39
40 574
            return $log;
41 1195
        });
42
43
        // チャネルに応じてログを作成し、フロント、管理、プラグイン用のログ出力クラスを作成
44 1195
        $channels = $app['config']['log']['channel'];
45
        // monologの設定は除外
46 1195
        unset($channels['monolog']);
47 1195
        foreach ($channels as $channel => $channelValues) {
48
            $app['monolog.logger.'.$channel] = $app->share(function ($app) use ($channelValues) {
49 574
                return $app['eccube.monolog.factory']($channelValues);
50 1195
            });
51
        }
52
53
        // MonologServiceProviderで定義されているmonolog.handlerの置換
54 1195
        $channelValues = $app['config']['log']['channel']['monolog'];
55 1195
        $app['monolog.name'] = $channelValues['name'];
56
        $app['monolog.handler'] = $app->share(function ($app) use ($channelValues) {
57 1193
            return $app['eccube.monolog.helper']->getHandler($channelValues);
58 1195
        });
59
60
        $app['eccube.monolog.listener'] = $app->share(function () use ($app) {
61 1192
            return new LogListener($app['eccube.logger']);
62 1195
        });
63
64 1195
        $app['listener.requestdump'] = $app->share(function ($app) {
65 1192
            return new \Eccube\EventListener\RequestDumpListener($app);
66 1195
        });
67
    }
68
69 1192
    public function boot(Application $app)
70
    {
71 1192
        $app['dispatcher']->addSubscriber($app['listener.requestdump']);
72 1192
        $app['dispatcher']->addSubscriber($app['eccube.monolog.listener']);
73
    }
74
}
75