Issues (1131)

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/database/Doctrine2Database.class.php (1 issue)

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
namespace Agavi\Database;
3
4
// +---------------------------------------------------------------------------+
5
// | This file is part of the Agavi package.                                   |
6
// | Copyright (c) 2005-2011 the Agavi Project.                                |
7
// |                                                                           |
8
// | For the full copyright and license information, please view the LICENSE   |
9
// | file that was distributed with this source code. You can also view the    |
10
// | LICENSE file online at http://www.agavi.org/LICENSE.txt                   |
11
// |   vi: set noexpandtab:                                                    |
12
// |   Local Variables:                                                        |
13
// |   indent-tabs-mode: t                                                     |
14
// |   End:                                                                    |
15
// +---------------------------------------------------------------------------+
16
17
/**
18
 * An abstract database adapter for the Doctrine2 DBAL and ORM.
19
 *
20
 * @package    agavi
21
 * @subpackage database
22
 *
23
 * @author     David Zülke <[email protected]>
24
 * @copyright  Authors
25
 * @copyright  The Agavi Project
26
 *
27
 * @since      1.0.6
28
 *
29
 * @version    $Id$
30
 */
31
abstract class Doctrine2Database extends Database
32
{
33
    /**
34
     * Prepare the configuration for this connection.
35
     *
36
     * @param      Doctrine\DBAL\Configuration The configuration object.
37
     *
38
     * @author     David Zülke <[email protected]>
39
     * @since      1.0.6
40
     */
41
    protected function prepareConfiguration(\Doctrine\DBAL\Configuration $config)
42
    {
43
    }
44
    
45
    /**
46
     * Prepare the event manager for this connection.
47
     *
48
     * @param      Doctrine\Common\EventManager The event manager object.
49
     *
50
     * @author     David Zülke <[email protected]>
51
     * @since      1.0.6
52
     */
53
    protected function prepareEventManager(\Doctrine\Common\EventManager $eventManager)
0 ignored issues
show
The parameter $eventManager 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...
54
    {
55
    }
56
    
57
    /**
58
     * Initialize the Doctrine2 ORM.
59
     *
60
     * @param      DatabaseManager $databaseManager The database manager of this instance.
61
     * @param      array           $parameters An assoc array of initialization params.
62
     *
63
     * @author     David Zülke <[email protected]>
64
     * @since      1.0.6
65
     */
66
    public function initialize(DatabaseManager $databaseManager, array $parameters = array())
67
    {
68
        parent::initialize($databaseManager, $parameters);
69
        
70
        if (!class_exists('Doctrine\Common\ClassLoader')) {
71
            // no soup for you!
72
            require('Doctrine/Common/ClassLoader.php'); // let's assume Doctrine2 is on ze include path...
73
        }
74
        
75
        // iterate over all declared class loaders and register them if necessary (checks performed to avoid duplicates for Doctrine's own namespaces)
76
        // by default, we assume an install via PEAR, with all of Doctrine in one folder and on the include path
77
        // if people want to do the smart thing and ship a Doctrine release with their app, they just need to point the entire "Doctrine" namespace to the path
78
        // for bleeding edge git stuff or similar, the paths for the namespaces can be given individually, see the Doctrine manual for examples
79
        foreach ((array)$this->getParameter('class_loaders', array('Doctrine' => null)) as $namespace => $includePath) {
80
            if ($namespace == 'Doctrine' && class_exists('Doctrine\ORM\Version')) {
81
                // the ORM namespace's Version class exists or could be autloaded; let's assume that the class loader for any Doctrine stuff won't need registration then
82
                continue;
83
            }
84
            if (strpos($namespace, 'Doctrine\\') === 0 && class_exists($namespace . '\Version')) {
85
                // it is a Doctrine namespace, and the namespace's Version class exists or could be autloaded; let's assume that the class loader won't need registration then
86
                continue;
87
            }
88
            
89
            // register the class loader for this namespace without further checks (there's unlikely to be further duplicates)
90
            $cl = new \Doctrine\Common\ClassLoader($namespace, $includePath);
91
            $cl->register();
92
        }
93
    }
94
    
95
    /**
96
     * Execute the shutdown procedure.
97
     *
98
     * @author     David Zülke <[email protected]>
99
     * @since      1.0.6
100
     */
101
    public function shutdown()
102
    {
103
        $this->connection = $this->resource = null;
104
    }
105
}
106