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.

Eccube/ServiceProvider/DebugServiceProvider.php (2 issues)

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
 * This file is part of EC-CUBE
4
 *
5
 * Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved.
6
 *
7
 * http://www.lockon.co.jp/
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
 */
23
24
25
namespace Eccube\ServiceProvider;
26
27
use Silex\Application;
28
use Silex\ServiceProviderInterface;
29
use Symfony\Bridge\Twig\Extension\DumpExtension;
30
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
31
use Symfony\Component\HttpKernel\DataCollector\DumpDataCollector;
32
use Symfony\Component\HttpKernel\EventListener\DumpListener;
33
use Symfony\Component\VarDumper\Cloner\VarCloner;
34
use Symfony\Component\VarDumper\Dumper\CliDumper;
35
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
36
use Symfony\Component\VarDumper\VarDumper;
37
38
/**
39
 * Debug Dump
40
 *
41
 * The MIT License (MIT)
42
 *
43
 * Copyright (c) 2014 Jérôme Macias
44
 *
45
 * Permission is hereby granted, free of charge, to any person obtaining a copy
46
 * of this software and associated documentation files (the "Software"), to deal
47
 * in the Software without restriction, including without limitation the rights
48
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
49
 * copies of the Software, and to permit persons to whom the Software is
50
 * furnished to do so, subject to the following conditions:
51
 *
52
 * The above copyright notice and this permission notice shall be included in all
53
 * copies or substantial portions of the Software.
54
 *
55
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
56
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
57
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
58
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
59
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
60
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
61
 * SOFTWARE.
62
 *
63
 * @see https://github.com/jeromemacias/Silex-Debug/tree/1.0
64
 *
65
 */
66
class DebugServiceProvider implements ServiceProviderInterface
67
{
68
    public function register(Application $app)
0 ignored issues
show
Missing function doc comment
Loading history...
69
    {
70
        $app['var_dumper.cloner'] = $app->share(function ($app) {
71
            $cloner = new VarCloner();
72
73
            if (isset($app['debug.max_items'])) {
74
                $cloner->setMaxItems($app['debug.max_items']);
75
            }
76
77
            if (isset($app['debug.max_string_length'])) {
78
                $cloner->setMaxString($app['debug.max_string_length']);
79
            }
80
81
            return $cloner;
82
        });
83
84
        $app['data_collector.templates'] = $app->share($app->extend('data_collector.templates', function ($templates) {
85
            return array_merge($templates, array(array('dump', '@Debug/Profiler/dump.html.twig')));
86
        }));
87
88
        $app['data_collector.dump'] = $app->share(function ($app) {
89
            return new DumpDataCollector($app['stopwatch'], $app['code.file_link_format'], null, null, new HtmlDumper());
90
        });
91
92
        $app['data_collectors'] = $app->share($app->extend('data_collectors', function ($collectors, $app) {
93
            $collectors['dump'] = $app->share(function ($app) {
94
                return $app['data_collector.dump'];
95
            });
96
97
            return $collectors;
98
        }));
99
100
        $app['twig'] = $app->share($app->extend('twig', function ($twig, $app) {
101
            if (class_exists('\Symfony\Bridge\Twig\Extension\DumpExtension')) {
102
                $twig->addExtension(new DumpExtension($app['var_dumper.cloner']));
103
            }
104
105
            return $twig;
106
        }));
107
108
        $app['twig.loader.filesystem'] = $app->share($app->extend('twig.loader.filesystem', function ($loader, $app) {
109
            $loader->addPath($app['debug.templates_path'], 'Debug');
110
111
            return $loader;
112
        }));
113
114
        $app['debug.templates_path'] = function () {
115
            $r = new \ReflectionClass('Symfony\Bundle\DebugBundle\DependencyInjection\Configuration');
116
117
            return dirname(dirname($r->getFileName())).'/Resources/views';
118
        };
119
    }
120
121
    public function boot(Application $app)
0 ignored issues
show
Missing function doc comment
Loading history...
122
    {
123
        // This code is here to lazy load the dump stack. This default
124
        // configuration for CLI mode is overridden in HTTP mode on
125
        // 'kernel.request' event
126
        VarDumper::setHandler(function ($var) use ($app) {
127
            $dumper = $app['data_collector.dump'];
128
            $cloner = $app['var_dumper.cloner'];
129
130
            $handler = function ($var) use ($dumper, $cloner) {
131
                $dumper->dump($cloner->cloneVar($var));
132
            };
133
134
            VarDumper::setHandler($handler);
135
            $handler($var);
136
        });
137
138
        $app['dispatcher']->addSubscriber(new DumpListener($app['var_dumper.cloner'], $app['data_collector.dump']));
139
    }
140
}
141