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/model/Model.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\Model;
3
4
// +---------------------------------------------------------------------------+
5
// | This file is part of the Agavi package.                                   |
6
// | Copyright (c) 2005-2011 the Agavi Project.                                |
7
// | Based on the Mojavi3 MVC Framework, Copyright (c) 2003-2005 Sean Kerr.    |
8
// |                                                                           |
9
// | For the full copyright and license information, please view the LICENSE   |
10
// | file that was distributed with this source code. You can also view the    |
11
// | LICENSE file online at http://www.agavi.org/LICENSE.txt                   |
12
// |   vi: set noexpandtab:                                                    |
13
// |   Local Variables:                                                        |
14
// |   indent-tabs-mode: t                                                     |
15
// |   End:                                                                    |
16
// +---------------------------------------------------------------------------+
17
use Agavi\Core\Context;
18
19
/**
20
 * Model provides a convention for separating business logic from
21
 * application logic. When using a model you're providing a globally accessible
22
 * API for other modules to access, which will boost interoperability among
23
 * modules in your web application.
24
 *
25
 * @package    agavi
26
 * @subpackage model
27
 *
28
 * @author     Sean Kerr <[email protected]>
29
 * @author     David Zülke <[email protected]>
30
 * @copyright  Authors
31
 * @copyright  The Agavi Project
32
 *
33
 * @since      0.9.0
34
 *
35
 * @version    $Id$
36
 */
37
abstract class Model implements ModelInterface
38
{
39
    /**
40
     * @var        Context A Context instance.
41
     */
42
    protected $context = null;
43
44
    /**
45
     * @var string The context name
46
     */
47
    protected $_contextName = null;
48
    /**
49
     * Retrieve the current application context.
50
     *
51
     * @return     Context The current Context instance.
52
     *
53
     * @author     Sean Kerr <[email protected]>
54
     * @since      0.9.0
55
     */
56
    final public function getContext()
57
    {
58
        return $this->context;
59
    }
60
61
    /**
62
     * Initialize this model.
63
     *
64
     * @param      Context $context The current application context.
65
     *
66
     * @author     Sean Kerr <[email protected]>
67
     * @since      0.9.0
68
     */
69
    public function initialize(Context $context, array $parameters = array())
0 ignored issues
show
The parameter $parameters 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...
70
    {
71
        $this->context = $context;
72
    }
73
74
    /**
75
     * Pre-serialization callback.
76
     *
77
     * Will set the name of the context and exclude the instance from serializing.
78
     *
79
     * @author     David Zülke <[email protected]>
80
     * @since      0.11.0
81
     */
82
    public function __sleep()
83
    {
84
        $this->_contextName = $this->context->getName();
85
        $arr = get_object_vars($this);
86
        unset($arr['context']);
87
        return array_keys($arr);
88
    }
89
90
    /**
91
     * Post-unserialization callback.
92
     *
93
     * Will restore the context based on the names set by __sleep.
94
     *
95
     * @author     David Zülke <[email protected]>
96
     * @since      0.11.0
97
     */
98
    public function __wakeup()
99
    {
100
        $this->context = Context::getInstance($this->_contextName);
101
        unset($this->_contextName);
102
    }
103
}
104