Issues (48)

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.

app/config/services.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
use Phalcon\DI\FactoryDefault;
4
use Phalcon\Mvc\View;
5
use Phalcon\Mvc\Url as UrlResolver;
6
use Phalcon\Db\Adapter\Pdo\Mysql as DbAdapter;
7
use Phalcon\Mvc\View\Engine\Volt as VoltEngine;
8
use Phalcon\Mvc\Model\Metadata\Memory as MetaDataAdapter;
9
use Phalcon\Session\Adapter\Files as SessionAdapter;
10
use Ajax\JsUtils;
11
use Ajax\Bootstrap;
12
use Phalcon\Mvc\Dispatcher as MvcDispatcher;
13
use Phalcon\Events\Manager as EventsManager;
14
15
/**
16
 * The FactoryDefault Dependency Injector automatically register the right services providing a full stack framework
17
 */
18
$di = new FactoryDefault();
19
20
/**
21
 * The URL component is used to generate all kind of urls in the application
22
 */
23
$di->set('url', function () use ($config) {
24
    $url = new UrlResolver();
25
    $url->setBaseUri($config->application->baseUri);
26
27
    return $url;
28
}, true);
29
30
/**
31
 * Setting up the view component
32
 */
33
$di->set('view', function () use ($config) {
34
35
    $view = new View();
36
37
    $view->setViewsDir($config->application->viewsDir);
38
39
    $view->registerEngines(array(
40
        '.volt' => function ($view, $di) use ($config) {
41
42
            $volt = new VoltEngine($view, $di);
43
44
            $volt->setOptions(array(
45
                'compiledPath' => $config->application->cacheDir,
46
                'compiledSeparator' => '_'
47
            ));
48
49
            return $volt;
50
        },
51
        '.phtml' => 'Phalcon\Mvc\View\Engine\Php'
52
    ));
53
54
    return $view;
55
}, true);
56
57
/**
58
 * Database connection is created based in the parameters defined in the configuration file
59
 */
60
$di->set('db', function () use ($config) {
61
    return new DbAdapter(array(
62
        'host' => $config->database->host,
63
        'username' => $config->database->username,
64
        'password' => $config->database->password,
65
        'dbname' => $config->database->dbname,
66
        'options' => array(
67
            PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'
68
        )
69
    ));
70
});
71
72
73
$di->set('baseUrl', function () use ($config) {
74
    $baseUrl = $config->application->baseUri;
75
    return $baseUrl;
76
});
77
78
/**
79
 * If the configuration specify the use of metadata adapter use it or use memory otherwise
80
 */
81
$di->set('modelsMetadata', function () {
82
    return new MetaDataAdapter();
83
});
84
85
/**
86
 * Start the session the first time some component request the session service
87
 */
88
$di->set('session', function () {
89
    $session = new SessionAdapter();
90
    $session->start();
91
92
    return $session;
93
});
94
95
$di->set("jquery", function () {
96
    $jquery = new JsUtils(array("driver" => "Jquery"));
97
    $jquery->bootstrap(new Bootstrap());
98
    return $jquery;
99
});
100
101
$di->set('dispatcher', function () {
102
103
    // Create an event manager
104
    $eventsManager = new EventsManager();
105
106
    // Attach a listener for type "dispatch"
107
    $eventsManager->attach("dispatch", function ($event, $dispatcher) {
0 ignored issues
show
The parameter $event is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
The parameter $dispatcher is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
108
        // ...
109
    });
110
111
    $dispatcher = new MvcDispatcher();
112
113
    // Bind the eventsManager to the view component
114
    $dispatcher->setEventsManager($eventsManager);
115
116
    return $dispatcher;
117
118
}, true);
119